Plugin Directory

Changeset 3092696


Ignore:
Timestamp:
05/26/2024 03:24:10 PM (21 months ago)
Author:
DeBAAT
Message:

Updated wp-media-category-management to 2.3.2: Fixed plugin failure

Location:
wp-media-category-management/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • wp-media-category-management/trunk/README.txt

    r3085104 r3092696  
    55Requires at least: 5.9
    66Tested up to: 6.5.3
    7 Stable tag: 2.3.1
     7Stable tag: 2.3.2
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    103103== Changelog ==
    104104
     105= 2.3.2 =
     106* Fixed plugin failure
     107
    105108= 2.3.1 =
    106109* Fixed plugin failure
  • wp-media-category-management/trunk/include/admin/class-WP_MCM_Admin.php

    r3085104 r3092696  
    103103         */
    104104        function wp_mcm_check_upgrade() {
    105             // $this->debugMP('msg',__FUNCTION__.' started.');
     105            $this->debugMP( 'msg', __FUNCTION__ . ' started.' );
    106106            global $wp_mcm_activate;
    107107            global $wp_mcm_options;
     
    155155                }
    156156            }
     157            $this->debugMP( 'msg', __FUNCTION__ . ' finished.' );
    157158        }
    158159
     
    166167                return;
    167168            }
     169            $this->debugMP( 'msg', __FUNCTION__ . ' started.' );
    168170            global $wp_mcm_options;
    169171            if ( wp_verify_nonce( esc_attr( $_REQUEST['nonce'] ), 'mcm_dismiss_notice' ) ) {
     
    198200            $network = false
    199201        ) {
     202            $this->debugMP( 'msg', __FUNCTION__ . ' started.' );
    200203            $this->notices[] = array(
    201204                'html'      => $html,
     
    215218         */
    216219        public function mcm_display_notice() {
     220            $this->debugMP( 'msg', __FUNCTION__ . ' started.' );
    217221            foreach ( $this->notices as $notice ) {
    218222                echo '
     
    234238                return;
    235239            }
     240            $this->debugMP( 'msg', __FUNCTION__ . ' started.' );
    236241            ?>
    237242            <script type="text/javascript">
     
    283288            $context
    284289        ) {
     290            $this->debugMP( 'msg', __FUNCTION__ . ' started.' );
    285291            // $this->debugMP('msg',__FUNCTION__.' started with plugin_file = ' . $plugin_file );
    286292            // $this->debugMP('pr', __FUNCTION__.' started with action_links = ', $action_links );
     
    297303         */
    298304        public function get_wp_mcm_action() {
    299             // $this->debugMP('msg',__FUNCTION__.' started.');
     305            $this->debugMP( 'msg', __FUNCTION__ . ' started.' );
    300306            if ( isset( $_REQUEST[WP_MCM_ACTION_REQUEST] ) ) {
    301307                if ( WP_MCM_ACTION_SETTINGS === $_REQUEST[WP_MCM_ACTION_REQUEST] && isset( $_REQUEST[WP_MCM_SETTINGS_TYPE_BUTTON] ) ) {
     
    490496         */
    491497        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.' );
    493499            $mcm_settings_section_url = wp_mcm_freemius_settings_url();
    494500            $mcm_settings_section_url = add_query_arg( array(
  • wp-media-category-management/trunk/include/class-WP_MCM_Options.php

    r3085104 r3092696  
    4040            'wp_mcm_notice_activation_date'      => '',
    4141        );
     42
     43        /**
     44         * Parameters for handling the settable options for this plugin.
     45         *
     46         * @var mixed[] $options
     47         */
     48        public $mcm_settings_params = array();
    4249
    4350        public function __construct() {
  • wp-media-category-management/trunk/include/class-WP_MCM_Plugin.php

    r3085104 r3092696  
    113113            add_action( 'init', array($this, 'wp_mcm_load_plugin_textdomain') );
    114114            // 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') );
    116116            // Load admin style sheet and scripts.
    117117            add_action( 'wp_enqueue_scripts', array($this, 'add_frontend_styles') );
     
    166166         * @return void
    167167         */
    168         public function mcm_action_dismiss_notice() {
     168        public function mcm_action_ajax_mcm_dismiss_notice() {
    169169            if ( !current_user_can( 'install_plugins' ) ) {
    170170                return;
    171171            }
     172            $this->debugMP( 'msg', __FUNCTION__ . ' started.' );
    172173            if ( wp_verify_nonce( esc_attr( $_REQUEST['nonce'] ), 'mcm_dismiss_notice' ) ) {
    173174                global $wp_mcm_options;
  • wp-media-category-management/trunk/include/media/class-WP_MCM_Media_Admin.php

    r3085104 r3092696  
    4343            add_action( 'restrict_manage_posts',                    array( $this, 'mcm_restrict_manage_posts'        )       );
    4444
    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'       )       );
    4646
    4747            add_action( 'add_attachment',                           array( $this, 'mcm_set_attachment_category'      )       );
     
    5555         * Enqueue the media-category-management scripts to filter categories
    5656         *
    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;
    6162            global $pagenow;
     63            global $wp_mcm_options;
    6264            global $wp_mcm_taxonomy;
    63             global $wp_mcm_options;
    6465            global $wp_mcm_walker_category_mediagrid_filter;
    6566            $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
    6669
    6770            // Get media taxonomy
     
    8588                'echo'            => false
    8689            );
    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 );
    8992
    9093            // Add an attachment_terms_list for All and No category
    9194            $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
    138115        }
    139116
     
    182159            switch ($media_taxonomy) {
    183160                case WP_MCM_TAGS_TAXONOMY:
    184                     return __( 'tags', 'wp-media-category-management' );
     161                    return esc_html__( 'tags', 'wp-media-category-management' );
    185162                    break;
    186163                case WP_MCM_POST_TAXONOMY:
    187                     return __( 'Post categories', 'wp-media-category-management' );
     164                    return esc_html__( 'Post categories', 'wp-media-category-management' );
    188165                    break;
    189166                default:
    190                     return __( 'MCM categories', 'wp-media-category-management' );
     167                    return esc_html__( 'MCM categories', 'wp-media-category-management' );
    191168                    break;
    192169            }
     
    215192            // Get some labels
    216193            $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;
    219196
    220197            switch ($media_taxonomy) {
     
    289266
    290267            // 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 ) ) {
    292269                return;
    293270            }
  • wp-media-category-management/trunk/include/taxonomy/class-WP_MCM_Taxonomy_Admin.php

    r3085104 r3092696  
    5252         */
    5353        function add_hooks_and_filters() {
    54             // $this->debugMP('msg', __FUNCTION__ . ' started.');
     54            $this->debugMP( 'msg', __FUNCTION__ . ' started.' );
    5555            // Some filters and action to process categories
    5656            add_filter(
     
    6060                2
    6161            );
    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 );
    6363            add_filter( 'request', array($this, 'mcm_request_admin') );
    6464            add_filter(
     
    262262
    263263        /**
    264          *  mcm_save_attachment_compat
     264         *  mcm_ajax_save_attachment_compat
    265265         *
    266266         *  Based on /wp-admin/includes/ajax-actions.php
     
    268268         *  @since    2.0.0
    269269         */
    270         function mcm_save_attachment_compat() {
     270        function mcm_ajax_save_attachment_compat() {
     271            $this->debugMP( 'msg', __FUNCTION__ . ' started.' );
    271272            if ( !isset( $_REQUEST['id'] ) ) {
    272273                wp_send_json_error();
  • wp-media-category-management/trunk/wp-media-category-management.php

    r3085104 r3092696  
    77Author:      DeBAAT
    88Author URI:  https://www.de-baat.nl/WP_MCM/
    9 Version:     2.3.1
     9Version:     2.3.2
    1010Text Domain: wp-media-category-management
    1111Domain Path: /languages/
     
    272272        return;
    273273    }
     274    // error_log( 'WP-MCM::' . __LINE__ . '::' . __FUNCTION__ . ' : DEFINED class = ' . $class );
    274275    // Make sure WP_MCM_Plugin itself is active.
    275276    if ( !class_exists( 'WP_MCM_Plugin' ) ) {
Note: See TracChangeset for help on using the changeset viewer.