wip
This commit is contained in:
@@ -554,6 +554,7 @@ final class WP_Customize_Widgets {
|
||||
* @see WP_Customize_Panel::$active_callback
|
||||
*
|
||||
* @global array $wp_registered_sidebars
|
||||
*
|
||||
* @return bool Active.
|
||||
*/
|
||||
public function is_panel_active() {
|
||||
@@ -832,7 +833,7 @@ final class WP_Customize_Widgets {
|
||||
$wp_scripts->add_data(
|
||||
'customize-widgets',
|
||||
'data',
|
||||
sprintf( 'var _wpCustomizeWidgetsSettings = %s;', wp_json_encode( $settings ) )
|
||||
sprintf( 'var _wpCustomizeWidgetsSettings = %s;', wp_json_encode( $settings, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) )
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -859,14 +860,14 @@ final class WP_Customize_Widgets {
|
||||
'wp.domReady( function() {
|
||||
wp.customizeWidgets.initialize( "widgets-customizer", %s );
|
||||
} );',
|
||||
wp_json_encode( $editor_settings )
|
||||
wp_json_encode( $editor_settings, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES )
|
||||
)
|
||||
);
|
||||
|
||||
// Preload server-registered block schemas.
|
||||
wp_add_inline_script(
|
||||
'wp-blocks',
|
||||
'wp.blocks.unstable__bootstrapServerSideBlockDefinitions(' . wp_json_encode( get_block_editor_server_block_settings() ) . ');'
|
||||
'wp.blocks.unstable__bootstrapServerSideBlockDefinitions(' . wp_json_encode( get_block_editor_server_block_settings(), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) . ');'
|
||||
);
|
||||
|
||||
// Preload server-registered block bindings sources.
|
||||
@@ -880,7 +881,7 @@ final class WP_Customize_Widgets {
|
||||
'usesContext' => $source->uses_context,
|
||||
);
|
||||
}
|
||||
$script = sprintf( 'for ( const source of %s ) { wp.blocks.registerBlockBindingsSource( source ); }', wp_json_encode( $filtered_sources ) );
|
||||
$script = sprintf( 'for ( const source of %s ) { wp.blocks.registerBlockBindingsSource( source ); }', wp_json_encode( $filtered_sources, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) );
|
||||
wp_add_inline_script(
|
||||
'wp-blocks',
|
||||
$script
|
||||
@@ -889,7 +890,7 @@ final class WP_Customize_Widgets {
|
||||
|
||||
wp_add_inline_script(
|
||||
'wp-blocks',
|
||||
sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( get_block_categories( $block_editor_context ) ) ),
|
||||
sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( get_block_categories( $block_editor_context ), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ),
|
||||
'after'
|
||||
);
|
||||
|
||||
@@ -921,10 +922,12 @@ final class WP_Customize_Widgets {
|
||||
</button>
|
||||
<h3>
|
||||
<span class="customize-action">
|
||||
<?php
|
||||
<?php
|
||||
$panel = $this->manager->get_panel( 'widgets' );
|
||||
$panel_title = isset( $panel->title ) ? $panel->title : __( 'Widgets' );
|
||||
/* translators: ▸ is the unicode right-pointing triangle. %s: Section title in the Customizer. */
|
||||
printf( __( 'Customizing ▸ %s' ), esc_html( $this->manager->get_panel( 'widgets' )->title ) );
|
||||
?>
|
||||
printf( __( 'Customizing ▸ %s' ), esc_html( $panel_title ) );
|
||||
?>
|
||||
</span>
|
||||
<?php _e( 'Add a Widget' ); ?>
|
||||
</h3>
|
||||
@@ -1332,7 +1335,7 @@ final class WP_Customize_Widgets {
|
||||
unset( $registered_widget['callback'] ); // May not be JSON-serializable.
|
||||
}
|
||||
wp_print_inline_script_tag(
|
||||
sprintf( 'var _wpWidgetCustomizerPreviewSettings = %s;', wp_json_encode( $settings ) )
|
||||
sprintf( 'var _wpWidgetCustomizerPreviewSettings = %s;', wp_json_encode( $settings, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ) . "\n//# sourceURL=" . rawurlencode( __METHOD__ )
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1805,14 +1808,14 @@ final class WP_Customize_Widgets {
|
||||
*
|
||||
* @since 4.5.0
|
||||
*
|
||||
* @see WP_Customize_Nav_Menus::filter_wp_nav_menu_args()
|
||||
*
|
||||
* @param array $params {
|
||||
* Dynamic sidebar params.
|
||||
*
|
||||
* @type array $args Sidebar args.
|
||||
* @type array $widget_args Widget args.
|
||||
* }
|
||||
* @see WP_Customize_Nav_Menus::filter_wp_nav_menu_args()
|
||||
*
|
||||
* @return array Params.
|
||||
*/
|
||||
public function filter_dynamic_sidebar_params( $params ) {
|
||||
|
||||
Reference in New Issue
Block a user