Custom Fields
Re-Envisioned
Support General Heads up on COLOR PICKER/ALPHA CHANNEL javascript error (Due to WP 5.5)

  • Creator
    Topic
  • #21464
    Resolved Teia Local Studio
    Participant

    Hey guys!

    Just updated to WordPress 5.5 and I got a error on JavaScript console on the ALPHA CHANNEL feature for COLOR PICKER. At first moment I did think it was related to the META BOX suite, however it is a general problem happening on many themes and plugins out there.

    So, I would suggest you to address a fix within Meta Box internals, because other people could think same way as me and come here asking for help.

    Color Picker/Alpha Channel error

    I understand it is a problem inside the COLOR PICKER code, but, anyway, I did fix it using this on my theme functions.php file:

    
    if( is_admin() ){
        add_action( 'wp_default_scripts', 'wp_default_custom_scripts' );
        function wp_default_custom_scripts( $scripts ){
            $scripts->add( 'wp-color-picker', "/wp-admin/js/color-picker.js", array( 'iris' ), false, 1 );
            did_action( 'init' ) && $scripts->localize(
                'wp-color-picker',
                'wpColorPickerL10n',
                array(
                    'clear'            => __( 'Clear' ),
                    'clearAriaLabel'   => __( 'Clear color' ),
                    'defaultString'    => __( 'Default' ),
                    'defaultAriaLabel' => __( 'Select default color' ),
                    'pick'             => __( 'Select Color' ),
                    'defaultLabel'     => __( 'Color value' ),
                )
            );
        }
    }
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #21469
    Long Nguyen
    Moderator

    Hi,

    Meta Box uses WP Color Picker Alpha as a library as many themes/plugins. This issue has been noticed and the developer has created a pull request to fix it https://github.com/kallookoo/wp-color-picker-alpha/pull/38. We are waiting for this PR will be merged and update the new version of Meta Box.

    Thanks for your code, it will help other users for temporary fixing.

    #22053
    Long Nguyen
    Moderator

    Solved in the new version 5.3.4 of Meta Box, please update the plugin to fix this issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.