Skip to content

Commit 1095bbf

Browse files
Fix current media post detection
1 parent 653eaf2 commit 1095bbf

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

classes/class-post-utils.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* File renaming on upload - WordPress Post Utils.
44
*
5-
* @version 2.6.1
5+
* @version 2.6.3
66
* @since 2.6.1
77
* @author WPFactory
88
*/
@@ -95,18 +95,16 @@ function get_current_media_post_id() {
9595
/**
9696
* get_current_media_post.
9797
*
98-
* @version 2.6.1
98+
* @version 2.6.3
9999
* @since 2.6.1
100100
*
101101
* @return array|false|mixed|\WP_Post|null
102102
*/
103103
function get_current_media_post() {
104-
if ( null === $this->current_media_post ) {
105-
$current_post_id = $this->get_current_media_post_id();
106-
$this->current_media_post = get_post( $current_post_id );
107-
if ( ! is_a( $this->current_media_post, 'WP_Post' ) ) {
108-
$this->current_media_post = false;
109-
}
104+
$current_post_id = $this->get_current_media_post_id();
105+
$this->current_media_post = get_post( $current_post_id );
106+
if ( ! is_a( $this->current_media_post, 'WP_Post' ) ) {
107+
$this->current_media_post = false;
110108
}
111109

112110
return $this->current_media_post;

file-renaming-on-upload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: File Renaming on upload
44
Plugin URI: https://wordpress.org/plugins/file-renaming-on-upload/
55
Description: Fixes file uploads with accents and special characters by renaming them. It also improves your SEO.
6-
Version: 2.6.2
6+
Version: 2.6.3
77
Text Domain: file-renaming-on-upload
88
Domain Path: /languages
99
Author: WPFactory

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: rename, seo, media, renaming, characters
44
Requires at least: 4.0.0
55
Tested up to: 6.7
66
Requires PHP: 5.3
7-
Stable tag: 2.6.2
7+
Stable tag: 2.6.3
88
License: GNU General Public License v3.0
99
License URI: http://www.gnu.org/licenses/gpl-3.0.html
1010

@@ -254,6 +254,9 @@ Head over to the [File Renaming on Upload plugin GitHub Repository](https://gith
254254

255255
== Changelog ==
256256

257+
= 2.6.3 - 2025/01/30 =
258+
* Fix - Fixed current media post detection.
259+
257260
= 2.6.2 - 2025/01/27 =
258261
* Fix - Fixed empty settings page.
259262

0 commit comments

Comments
 (0)