Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wpColorPickerL10n not defined in WP 5.5 #433

Open
majick777 opened this issue Sep 24, 2020 · 0 comments
Open

wpColorPickerL10n not defined in WP 5.5 #433

majick777 opened this issue Sep 24, 2020 · 0 comments

Comments

@majick777
Copy link

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' ),
	) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant