Changeset 3374394
- Timestamp:
- 10/07/2025 12:34:32 PM (5 months ago)
- Location:
- media-library-plus/trunk
- Files:
-
- 3 edited
-
media-library-plus.php (modified) (5 diffs)
-
mlp-reset.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
media-library-plus/trunk/media-library-plus.php
r3363957 r3374394 4 4 Plugin URI: https://maxgalleria.com 5 5 Description: Gives you the ability to adds folders and move files in the WordPress Media Library. 6 Version: 8.3. 36 Version: 8.3.4 7 7 Author: Max Foundry 8 8 Author URI: https://maxfoundry.com … … 76 76 public function set_global_constants() { 77 77 define('MAXGALLERIA_MEDIA_LIBRARY_VERSION_KEY', 'maxgalleria_media_library_version'); 78 define('MAXGALLERIA_MEDIA_LIBRARY_VERSION_NUM', '8.3. 3');78 define('MAXGALLERIA_MEDIA_LIBRARY_VERSION_NUM', '8.3.4'); 79 79 define('MAXGALLERIA_MEDIA_LIBRARY_IGNORE_NOTICE', 'maxgalleria_media_library_ignore_notice'); 80 80 define('MAXGALLERIA_MEDIA_LIBRARY_PLUGIN_NAME', trim(dirname(plugin_basename(__FILE__)), '/')); … … 3059 3059 global $wpdb, $maxgalleria; 3060 3060 3061 if (!wp_verify_nonce($_POST['nonce'], MAXGALLERIA_MEDIA_LIBRARY_ PRO_NONCE)) {3061 if (!wp_verify_nonce($_POST['nonce'], MAXGALLERIA_MEDIA_LIBRARY_NONCE)) { 3062 3062 exit(__('missing nonce!', 'maxgalleria-media-library')); 3063 3063 } … … 3112 3112 3113 3113 die(); 3114 } 3115 3114 } 3115 3116 public function add_image_to_mg_gallery($attachment_id, $gallery_id) { 3117 3118 global $wpdb, $maxgalleria; 3119 3120 $result = $attachment_id; 3121 3122 // check for image already in the gallery 3123 $sql = "SELECT ID FROM $wpdb->prefix" . "posts where post_parent = $gallery_id and post_type = 'attachment' and ID = $attachment_id"; 3124 3125 $row = $wpdb->get_row($sql); 3126 3127 if($row === null) { 3128 3129 $menu_order = $maxgalleria->common->get_next_menu_order($gallery_id); 3130 3131 $attachment = get_post( $attachment_id, ARRAY_A ); 3132 3133 // assign a new value for menu_order 3134 //$menu_order = $maxgalleria->common->get_next_menu_order($gallery_id); 3135 $attachment[ 'menu_order' ] = $menu_order; 3136 3137 //If the attachment doesn't have a post parent, simply change it to the attachment we're working with and be done with it 3138 // assign a new value for menu_order 3139 if( empty( $attachment[ 'post_parent' ] ) ) { 3140 wp_update_post( 3141 array( 3142 'ID' => $attachment[ 'ID' ], 3143 'post_parent' => $gallery_id, 3144 'menu_order' => $menu_order 3145 ) 3146 ); 3147 $result = $attachment[ 'ID' ]; 3148 } else { 3149 //Else, unset the attachment ID, change the post parent and insert a new attachment 3150 unset( $attachment[ 'ID' ] ); 3151 $attachment[ 'post_parent' ] = $gallery_id; 3152 $new_attachment_id = wp_insert_post( $attachment ); 3153 //$new_attachment_id = $this->mpmlp_insert_post( $attachment ); 3154 3155 //Now, duplicate all the custom fields. (There's probably a better way to do this) 3156 $custom_fields = get_post_custom( $attachment_id ); 3157 3158 foreach( $custom_fields as $key => $value ) { 3159 //The attachment metadata wasn't duplicating correctly so we do that below instead 3160 if( $key != '_wp_attachment_metadata' ) 3161 update_post_meta( $new_attachment_id, $key, $value[0] ); 3162 } 3163 3164 //Carry over the attachment metadata 3165 $data = wp_get_attachment_metadata( $attachment_id ); 3166 wp_update_attachment_metadata( $new_attachment_id, $data ); 3167 3168 $result = $new_attachment_id; 3169 3170 } 3171 } 3172 3173 return $result; 3174 3175 } 3176 3116 3177 public function search_media () { 3117 3178 … … 5055 5116 public function mflp_enable_auto_protect() { 5056 5117 5057 if ( !wp_verify_nonce( $_POST['nonce'], MAXGALLERIA_MEDIA_LIBRARY_ PRO_NONCE)) {5118 if ( !wp_verify_nonce( $_POST['nonce'], MAXGALLERIA_MEDIA_LIBRARY_NONCE)) { 5058 5119 exit(__('missing nonce!','maxgalleria-media-library')); 5059 5120 } -
media-library-plus/trunk/mlp-reset.php
r3363957 r3374394 6 6 Author: Max Foundry 7 7 Author URI: https://maxfoundry.com 8 Version: 8.3. 38 Version: 8.3.4 9 9 Copyright 2015-2021 Max Foundry, LLC (https://maxfoundry.com) 10 10 Text Domain: mlp-reset -
media-library-plus/trunk/readme.txt
r3363957 r3374394 3 3 Tags: media library folders, media library folders, organize media library 4 4 Requires at least: 4.0 5 Tested up to: 6.8. 16 Stable tag: 8.3. 35 Tested up to: 6.8.3 6 Stable tag: 8.3.4 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 233 233 234 234 == Changelog == 235 = 8.3.4 = 236 * Fixed issue with adding images to a MaxGallery gallery 237 235 238 = 8.3.3 = 236 239 * Added code to fix image alt data causing issues in PHP 8.3
Note: See TracChangeset
for help on using the changeset viewer.