Media File Renamer - Version 3.6.8

Version Description

  • Add: Little API.
Download this release

Release Info

Developer TigrouMeow
Plugin Icon 128x128 Media File Renamer
Version 3.6.8
Comparing to
See all releases

Code changes from version 3.6.7 to 3.6.8

Files changed (4) hide show
  1. api.php +15 -0
  2. core.php +5 -0
  3. media-file-renamer.php +3 -3
  4. readme.txt +4 -1
api.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * FUNCTIONS THAT CAN BE USED BY THEMES/PLUGINS DEVELOPERS
6
+ *
7
+ */
8
+
9
+ // Rename the media automatically based on the settings
10
+ function mfrh_rename( $mediaId ) {
11
+ global $mfrh_core;
12
+ return $mfrh_core->rename( $mediaId );
13
+ }
14
+
15
+ ?>
core.php CHANGED
@@ -16,6 +16,7 @@ class Meow_MFRH_Core {
16
  function init() {
17
 
18
  include( 'mfrh_custom.php' );
 
19
 
20
  global $mfrh_version;
21
  load_plugin_textdomain( 'media-file-renamer', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
@@ -924,6 +925,10 @@ class Meow_MFRH_Core {
924
  str_replace( $upload_dir, "", $new_image_url ) );
925
  }
926
 
 
 
 
 
927
  function rename_media( $post, $attachment, $disableMediaLibraryMode = false, $forceFilename = null ) {
928
  $force = !empty( $forceFilename );
929
  $manual = get_post_meta( $post['ID'], '_manual_file_renaming', true );
16
  function init() {
17
 
18
  include( 'mfrh_custom.php' );
19
+ include( 'api.php' );
20
 
21
  global $mfrh_version;
22
  load_plugin_textdomain( 'media-file-renamer', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
925
  str_replace( $upload_dir, "", $new_image_url ) );
926
  }
927
 
928
+ function rename( $mediaId ) {
929
+ return $this->rename_media( get_post( $mediaId, ARRAY_A ) );
930
+ }
931
+
932
  function rename_media( $post, $attachment, $disableMediaLibraryMode = false, $forceFilename = null ) {
933
  $force = !empty( $forceFilename );
934
  $manual = get_post_meta( $post['ID'], '_manual_file_renaming', true );
media-file-renamer.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Media File Renamer
4
  Plugin URI: http://meowapps.com
5
  Description: Auto-rename the files when titles are modified and update and the references (links). Manual Rename is a Pro option. Please read the description.
6
- Version: 3.6.7
7
  Author: Jordy Meow
8
  Author URI: http://meowapps.com
9
  Text Domain: media-file-renamer
@@ -28,8 +28,8 @@ if ( class_exists( 'Meow_MFRH_Core' ) ) {
28
 
29
  if ( is_admin() ) {
30
 
31
- global $mfrh_version;
32
- $mfrh_version = '3.6.7';
33
 
34
  // Admin
35
  require( 'mfrh_admin.php');
3
  Plugin Name: Media File Renamer
4
  Plugin URI: http://meowapps.com
5
  Description: Auto-rename the files when titles are modified and update and the references (links). Manual Rename is a Pro option. Please read the description.
6
+ Version: 3.6.8
7
  Author: Jordy Meow
8
  Author URI: http://meowapps.com
9
  Text Domain: media-file-renamer
28
 
29
  if ( is_admin() ) {
30
 
31
+ global $mfrh_version, $mfrh_core;
32
+ $mfrh_version = '3.6.8';
33
 
34
  // Admin
35
  require( 'mfrh_admin.php');
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: TigrouMeow
3
  Tags: rename, file, media, management, image, renamer, wpml, wp-retina-2x
4
  Requires at least: 4.2
5
  Tested up to: 4.8
6
- Stable tag: 3.6.7
7
 
8
  Automatically rename files depending on Media titles dynamically + update links. Pro version has many more options. Check the description :)
9
 
@@ -100,6 +100,9 @@ You are welcome to create plugins using Media File Renamer using special rules f
100
 
101
  == Changelog ==
102
 
 
 
 
103
  = 3.6.7 =
104
  * Add: Bulk rename in the Media Library.
105
 
3
  Tags: rename, file, media, management, image, renamer, wpml, wp-retina-2x
4
  Requires at least: 4.2
5
  Tested up to: 4.8
6
+ Stable tag: 3.6.8
7
 
8
  Automatically rename files depending on Media titles dynamically + update links. Pro version has many more options. Check the description :)
9
 
100
 
101
  == Changelog ==
102
 
103
+ = 3.6.8 =
104
+ * Add: Little API.
105
+
106
  = 3.6.7 =
107
  * Add: Bulk rename in the Media Library.
108