Changeset 3092696
- Timestamp:
- 05/26/2024 03:24:10 PM (21 months ago)
- Location:
- wp-media-category-management/trunk
- Files:
-
- 7 edited
-
README.txt (modified) (2 diffs)
-
include/admin/class-WP_MCM_Admin.php (modified) (9 diffs)
-
include/class-WP_MCM_Options.php (modified) (1 diff)
-
include/class-WP_MCM_Plugin.php (modified) (2 diffs)
-
include/media/class-WP_MCM_Media_Admin.php (modified) (6 diffs)
-
include/taxonomy/class-WP_MCM_Taxonomy_Admin.php (modified) (4 diffs)
-
wp-media-category-management.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-media-category-management/trunk/README.txt
r3085104 r3092696 5 5 Requires at least: 5.9 6 6 Tested up to: 6.5.3 7 Stable tag: 2.3. 17 Stable tag: 2.3.2 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 103 103 == Changelog == 104 104 105 = 2.3.2 = 106 * Fixed plugin failure 107 105 108 = 2.3.1 = 106 109 * Fixed plugin failure -
wp-media-category-management/trunk/include/admin/class-WP_MCM_Admin.php
r3085104 r3092696 103 103 */ 104 104 function wp_mcm_check_upgrade() { 105 // $this->debugMP('msg',__FUNCTION__.' started.');105 $this->debugMP( 'msg', __FUNCTION__ . ' started.' ); 106 106 global $wp_mcm_activate; 107 107 global $wp_mcm_options; … … 155 155 } 156 156 } 157 $this->debugMP( 'msg', __FUNCTION__ . ' finished.' ); 157 158 } 158 159 … … 166 167 return; 167 168 } 169 $this->debugMP( 'msg', __FUNCTION__ . ' started.' ); 168 170 global $wp_mcm_options; 169 171 if ( wp_verify_nonce( esc_attr( $_REQUEST['nonce'] ), 'mcm_dismiss_notice' ) ) { … … 198 200 $network = false 199 201 ) { 202 $this->debugMP( 'msg', __FUNCTION__ . ' started.' ); 200 203 $this->notices[] = array( 201 204 'html' => $html, … … 215 218 */ 216 219 public function mcm_display_notice() { 220 $this->debugMP( 'msg', __FUNCTION__ . ' started.' ); 217 221 foreach ( $this->notices as $notice ) { 218 222 echo ' … … 234 238 return; 235 239 } 240 $this->debugMP( 'msg', __FUNCTION__ . ' started.' ); 236 241 ?> 237 242 <script type="text/javascript"> … … 283 288 $context 284 289 ) { 290 $this->debugMP( 'msg', __FUNCTION__ . ' started.' ); 285 291 // $this->debugMP('msg',__FUNCTION__.' started with plugin_file = ' . $plugin_file ); 286 292 // $this->debugMP('pr', __FUNCTION__.' started with action_links = ', $action_links ); … … 297 303 */ 298 304 public function get_wp_mcm_action() { 299 // $this->debugMP('msg',__FUNCTION__.' started.');305 $this->debugMP( 'msg', __FUNCTION__ . ' started.' ); 300 306 if ( isset( $_REQUEST[WP_MCM_ACTION_REQUEST] ) ) { 301 307 if ( WP_MCM_ACTION_SETTINGS === $_REQUEST[WP_MCM_ACTION_REQUEST] && isset( $_REQUEST[WP_MCM_SETTINGS_TYPE_BUTTON] ) ) { … … 490 496 */ 491 497 public function wp_mcm_settings_section_url( $mcm_settings_section = WP_MCM_SECTION_SETTINGS ) { 492 // $this->debugMP('msg',__FUNCTION__.' started.');498 $this->debugMP( 'msg', __FUNCTION__ . ' started.' ); 493 499 $mcm_settings_section_url = wp_mcm_freemius_settings_url(); 494 500 $mcm_settings_section_url = add_query_arg( array( -
wp-media-category-management/trunk/include/class-WP_MCM_Options.php
r3085104 r3092696 40 40 'wp_mcm_notice_activation_date' => '', 41 41 ); 42 43 /** 44 * Parameters for handling the settable options for this plugin. 45 * 46 * @var mixed[] $options 47 */ 48 public $mcm_settings_params = array(); 42 49 43 50 public function __construct() { -
wp-media-category-management/trunk/include/class-WP_MCM_Plugin.php
r3085104 r3092696 113 113 add_action( 'init', array($this, 'wp_mcm_load_plugin_textdomain') ); 114 114 // Add the options dismiss_notice. 115 add_action( 'wp_ajax_mcm_dismiss_notice', array($this, 'mcm_action_ dismiss_notice') );115 add_action( 'wp_ajax_mcm_dismiss_notice', array($this, 'mcm_action_ajax_mcm_dismiss_notice') ); 116 116 // Load admin style sheet and scripts. 117 117 add_action( 'wp_enqueue_scripts', array($this, 'add_frontend_styles') ); … … 166 166 * @return void 167 167 */ 168 public function mcm_action_ dismiss_notice() {168 public function mcm_action_ajax_mcm_dismiss_notice() { 169 169 if ( !current_user_can( 'install_plugins' ) ) { 170 170 return; 171 171 } 172 $this->debugMP( 'msg', __FUNCTION__ . ' started.' ); 172 173 if ( wp_verify_nonce( esc_attr( $_REQUEST['nonce'] ), 'mcm_dismiss_notice' ) ) { 173 174 global $wp_mcm_options; -
wp-media-category-management/trunk/include/media/class-WP_MCM_Media_Admin.php
r3085104 r3092696 43 43 add_action( 'restrict_manage_posts', array( $this, 'mcm_restrict_manage_posts' ) ); 44 44 45 add_action( ' admin_enqueue_scripts', array( $this, 'mcm_admin_enqueue_scripts') );45 add_action( 'wp_enqueue_media', array( $this, 'mcm_admin_wp_enqueue_media' ) ); 46 46 47 47 add_action( 'add_attachment', array( $this, 'mcm_set_attachment_category' ) ); … … 55 55 * Enqueue the media-category-management scripts to filter categories 56 56 * 57 * @since 2.0.0 58 * @return void 59 */ 60 function mcm_admin_enqueue_scripts() { 57 * @since 2.3.2 58 * @return void 59 */ 60 function mcm_admin_wp_enqueue_media() { 61 global $current_screen; 61 62 global $pagenow; 63 global $wp_mcm_options; 62 64 global $wp_mcm_taxonomy; 63 global $wp_mcm_options;64 65 global $wp_mcm_walker_category_mediagrid_filter; 65 66 $this->debugMP('msg',__FUNCTION__ . ' pagenow = ' . $pagenow . ', wp_script_is( media-editor ) = ' . wp_script_is( 'media-editor' )); 67 $this->debugMP('pr',__FUNCTION__ . ' current_screen = !', $current_screen ); 68 66 69 67 70 // Get media taxonomy … … 85 88 'echo' => false 86 89 ); 87 $attachment_terms_list = wp_dropdown_categories( $dropdown_options );88 $attachment_terms_string = preg_replace( array( "/<select([^>]*)>/", "/<\/select>/" ), "", $attachment_terms_list );90 $attachment_terms_list = get_terms( $dropdown_options ); 91 // $this->debugMP('pr',__FUNCTION__ . ' attachment_terms_list = !', $attachment_terms_list ); 89 92 90 93 // Add an attachment_terms_list for All and No category 91 94 $mcm_terms_label = $this->mcm_get_media_category_label($media_taxonomy); 92 $mcm_terms_label_all = __( 'Show all', 'wp-media-category-management' ) . ' ' . $mcm_terms_label; 93 $mcm_terms_label_none = __( 'No', 'wp-media-category-management' ) . ' ' . $mcm_terms_label; 94 $no_category_term = ' ,{"term_id":"' . WP_MCM_OPTION_NO_CAT . '","term_name":"' . $mcm_terms_label_none . '"}'; 95 $attachment_terms_string = $no_category_term . substr( $attachment_terms_string, 1 ); 96 // $this->debugMP('msg',__FUNCTION__ . ' attachment_terms_string = !' . $attachment_terms_string . '!'); 97 $this->debugMP('pr',__FUNCTION__ . ' attachment_terms_list = !', $attachment_terms_list ); 98 99 // Enqueue the media scripts always, not only on post pages. 100 // if ( ( ('upload.php' == $pagenow ) || ('post.php' == $pagenow ) || ('post-new.php' == $pagenow ) ) && ($wp_mcm_options->is_true('wp_mcm_use_gutenberg_filter')) ) { 101 if ( ('upload.php' == $pagenow ) || ('post.php' == $pagenow ) || ('post-new.php' == $pagenow ) ) { 102 103 $attachment_terms_list = get_terms( $dropdown_options ); 104 $this->debugMP('pr',__FUNCTION__ . ' attachment_terms_list = !', $attachment_terms_list ); 105 106 // create my own version codes for taxonomies 107 wp_enqueue_script( 'mcm-media-views', WP_MCM_PLUGIN_URL . '/js/wp-mcm-media-views-post-terms.js', array( 'media-views' ), WP_MCM_VERSION_NUM . WP_MCM_JS_DEV_VERSION, false ); 108 109 wp_localize_script( 110 'mcm-media-views', 111 'wpmcm_admin_js_terms', 112 array( 113 'ajax_url' => admin_url( 'admin-ajax.php' ), 114 'spinner_url' => includes_url() . '/images/spinner.gif', 115 'mcm_terms_key' => $media_taxonomy, 116 'mcm_terms_label' => $mcm_terms_label, 117 'mcm_terms_label_all' => $mcm_terms_label_all, 118 'mcm_terms_label_none' => $mcm_terms_label_none, 119 'mcm_terms_list' => $attachment_terms_list, 120 ) 121 ); 122 123 124 } else { 125 126 echo '<script type="text/javascript">'; 127 echo '/* <![CDATA[ */'; 128 echo 'var mcm_taxonomies = {"' . esc_js( $media_taxonomy ) . '":'; 129 echo '{"term_list_title":"' . esc_js( html_entity_decode( $mcm_terms_label_all, ENT_QUOTES, 'UTF-8' ) ) . '",'; 130 echo '"mcm_terms_list":[' . esc_js( substr( $attachment_terms_string, 2 ) ) . ']}};'; 131 echo '/* ]]> */'; 132 echo '</script>'; 133 $this->debugMP('msg',__FUNCTION__ . ' attachment_terms_string = !' . $attachment_terms_string . '!'); 134 135 wp_enqueue_script( 'mcm-media-views', WP_MCM_PLUGIN_URL . '/js/wp-mcm-media-views-terms.js', array( 'media-views' ), WP_MCM_VERSION_NUM . WP_MCM_JS_DEV_VERSION, true ); 136 137 } 95 $mcm_terms_label_all = esc_html__( 'Show all', 'wp-media-category-management' ) . ' ' . $mcm_terms_label; 96 $mcm_terms_label_none = esc_html__( 'No', 'wp-media-category-management' ) . ' ' . $mcm_terms_label; 97 98 // create my own version codes for taxonomies 99 wp_enqueue_script( 'mcm-media-views', WP_MCM_PLUGIN_URL . '/js/wp-mcm-media-views-post-terms.js', array( 'media-views' ), WP_MCM_VERSION_NUM . WP_MCM_JS_DEV_VERSION, false ); 100 101 wp_localize_script( 102 'mcm-media-views', 103 'wpmcm_admin_js_terms', 104 array( 105 'ajax_url' => admin_url( 'admin-ajax.php' ), 106 'spinner_url' => includes_url() . '/images/spinner.gif', 107 'mcm_terms_key' => $media_taxonomy, 108 'mcm_terms_label' => $mcm_terms_label, 109 'mcm_terms_label_all' => $mcm_terms_label_all, 110 'mcm_terms_label_none' => $mcm_terms_label_none, 111 'mcm_terms_list' => $attachment_terms_list, 112 ) 113 ); 114 138 115 } 139 116 … … 182 159 switch ($media_taxonomy) { 183 160 case WP_MCM_TAGS_TAXONOMY: 184 return __( 'tags', 'wp-media-category-management' );161 return esc_html__( 'tags', 'wp-media-category-management' ); 185 162 break; 186 163 case WP_MCM_POST_TAXONOMY: 187 return __( 'Post categories', 'wp-media-category-management' );164 return esc_html__( 'Post categories', 'wp-media-category-management' ); 188 165 break; 189 166 default: 190 return __( 'MCM categories', 'wp-media-category-management' );167 return esc_html__( 'MCM categories', 'wp-media-category-management' ); 191 168 break; 192 169 } … … 215 192 // Get some labels 216 193 $mcm_label = $this->mcm_get_media_category_label($media_taxonomy); 217 $mcm_label_all = __( 'View all', 'wp-media-category-management' ) . ' ' . $mcm_label;218 $mcm_label_no = __( 'No', 'wp-media-category-management' ) . ' ' . $mcm_label;194 $mcm_label_all = esc_html__( 'View all', 'wp-media-category-management' ) . ' ' . $mcm_label; 195 $mcm_label_no = esc_html__( 'No', 'wp-media-category-management' ) . ' ' . $mcm_label; 219 196 220 197 switch ($media_taxonomy) { … … 289 266 290 267 // Check whether this user can edit this post 291 if ( ! current_user_can( 'edit_post', $post_ID ) ) {268 if ( ! current_user_can( 'edit_post', $post_ID ) ) { 292 269 return; 293 270 } -
wp-media-category-management/trunk/include/taxonomy/class-WP_MCM_Taxonomy_Admin.php
r3085104 r3092696 52 52 */ 53 53 function add_hooks_and_filters() { 54 // $this->debugMP('msg', __FUNCTION__ . ' started.');54 $this->debugMP( 'msg', __FUNCTION__ . ' started.' ); 55 55 // Some filters and action to process categories 56 56 add_filter( … … 60 60 2 61 61 ); 62 add_action( 'wp_ajax_save-attachment-compat', array($this, 'mcm_ save_attachment_compat'), 0 );62 add_action( 'wp_ajax_save-attachment-compat', array($this, 'mcm_ajax_save_attachment_compat'), 0 ); 63 63 add_filter( 'request', array($this, 'mcm_request_admin') ); 64 64 add_filter( … … 262 262 263 263 /** 264 * mcm_ save_attachment_compat264 * mcm_ajax_save_attachment_compat 265 265 * 266 266 * Based on /wp-admin/includes/ajax-actions.php … … 268 268 * @since 2.0.0 269 269 */ 270 function mcm_save_attachment_compat() { 270 function mcm_ajax_save_attachment_compat() { 271 $this->debugMP( 'msg', __FUNCTION__ . ' started.' ); 271 272 if ( !isset( $_REQUEST['id'] ) ) { 272 273 wp_send_json_error(); -
wp-media-category-management/trunk/wp-media-category-management.php
r3085104 r3092696 7 7 Author: DeBAAT 8 8 Author URI: https://www.de-baat.nl/WP_MCM/ 9 Version: 2.3. 19 Version: 2.3.2 10 10 Text Domain: wp-media-category-management 11 11 Domain Path: /languages/ … … 272 272 return; 273 273 } 274 // error_log( 'WP-MCM::' . __LINE__ . '::' . __FUNCTION__ . ' : DEFINED class = ' . $class ); 274 275 // Make sure WP_MCM_Plugin itself is active. 275 276 if ( !class_exists( 'WP_MCM_Plugin' ) ) {
Note: See TracChangeset
for help on using the changeset viewer.