Widgets: Prevent fatal error due to calling undefined wp_json_encode()
when requesting the load-scripts.php
endpoint.
Props Otto42. Amends [41352]. Fixes #41610. git-svn-id: https://develop.svn.wordpress.org/trunk@41360 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
798c1894f4
commit
249c416f0d
@ -672,7 +672,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
$scripts->add( 'admin-gallery', "/wp-admin/js/gallery$suffix.js", array( 'jquery-ui-sortable' ) );
|
||||
|
||||
$scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), false, 1 );
|
||||
$scripts->add_inline_script( 'admin-widgets', sprintf( 'wpWidgets.l10n = %s;', wp_json_encode( array(
|
||||
did_action( 'init' ) && $scripts->add_inline_script( 'admin-widgets', sprintf( 'wpWidgets.l10n = %s;', wp_json_encode( array(
|
||||
'save' => __( 'Save' ),
|
||||
'saved' => __( 'Saved' ),
|
||||
'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ),
|
||||
|
Loading…
Reference in New Issue
Block a user