Skip to content

wpColorPickerL10n not defined in WP 5.5 #433

@majick777

Description

@majick777

wpColorPickerL10n is deprecated in WP 5.5 (erk!) and Titan throws undefined variable in js\wp-color-picker-alpha.js

Workaround (via previous /wp-includes/script-loader.php):

add_action( 'wp_print_scripts', 'titan_color_picker_translation_fix', 11 );
function titan_color_picker_translation_fix() {
	$wp_scripts = wp_scripts();
	$wp_scripts->localize( 'wp-color-picker', 'wpColorPickerL10n', array(
		'clear'            => __( 'Clear' ),
		'clearAriaLabel'   => __( 'Clear color' ),
		'defaultString'    => __( 'Default' ),
		'defaultAriaLabel' => __( 'Select default color' ),
		'pick'             => __( 'Select Color' ),
		'defaultLabel'     => __( 'Color value' ),
	) );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions