Support » Plugin: Elementor Website Builder » WordPress 5.5 update Crashing Elementor Color Picker Issue

  • When trying to edit any page in elementor it will not load. Throws error: Uncaught Error is ‘Uncaught Reference Error:’ ‘wpColorPickerL1On is not defined’. Researching I found this: https://core.trac.wordpress.org/ticket/50857 and it references the same issue. But looks like it is over 1000 plugins that are affected because of the color picker in wordpress. Specifically the article references issue with color picker:
    wpColorPickerL10n is not defined and says…

    It happens because there is no script that was in the previous WordPress versions.

    <script>
    var wpColorPickerL10n = {"clear":"Clear","clearAriaLabel":"Clear color","defaultString":"Default","defaultAriaLabel":"Select default color","pick":"Select Color","defaultLabel":"Color value"};
    </script>

    But does not state where that would have gone. Help finding that is welcome????

    The page I need help with: [log in to see the link]

Viewing 7 replies - 16 through 22 (of 22 total)
  • @wpthemedevelopers This same issue cropped up when using YITH Multi Step Checkout (since it displays some color pickers in settings) and your fix is spot on! Thanks a lot!

    omnrohr

    (@omnrohr)

    Hi, This code solved the issue, paste it into child theme function 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' ),
    			)
    		);
    	}
    }
    • This reply was modified 3 months ago by omnrohr.
    ttduongtran

    (@ttduongtran)

    Thank you @wpthemedevelopers
    It works for me.

    For us this has been solved in WordPress 5.5.1 so we’re removing the work-around code again.

    Thanks for providing it, though!

    Hier ook Waar in het Fuctions bestand moet ik de genoemde code

    add_action( ‘wp_print_scripts’, ‘pp_deregister_javascript’, 99 );

    function pp_deregister_javascript() {
    if(!is_admin())
    {
    wp_dequeue_script(‘wp-color-picker’);
    wp_deregister_script( ‘jquery-ui-datepicker’ );
    wp_deregister_script( ‘wp-color-picker-js-extra’ );
    wp_deregister_script( ‘wp-color-picker’ );

    }

    }

    plaatsten?

    @wpthemedevelopers your solution is not working for my websites. I am still unable to work with the elementor.

    and if you do not have a child theme? Where should I paste this?

Viewing 7 replies - 16 through 22 (of 22 total)
  • You must be logged in to reply to this topic.