wp/wp-includes/class-wp-customize-widgets.php
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
--- a/wp/wp-includes/class-wp-customize-widgets.php	Wed Sep 21 18:19:35 2022 +0200
+++ b/wp/wp-includes/class-wp-customize-widgets.php	Tue Sep 27 16:37:53 2022 +0200
@@ -238,13 +238,13 @@
 	 *
 	 * @since 3.9.0
 	 *
-	 * @param string $name    Post value.
-	 * @param mixed  $default Default post value.
+	 * @param string $name          Post value.
+	 * @param mixed  $default_value Default post value.
 	 * @return mixed Unslashed post value or default value.
 	 */
-	protected function get_post_value( $name, $default = null ) {
+	protected function get_post_value( $name, $default_value = null ) {
 		if ( ! isset( $_POST[ $name ] ) ) {
-			return $default;
+			return $default_value;
 		}
 
 		return wp_unslash( $_POST[ $name ] );
@@ -420,6 +420,7 @@
 				'priority'                 => 110,
 				'active_callback'          => array( $this, 'is_panel_active' ),
 				'auto_expand_sole_section' => true,
+				'theme_supports'           => 'widgets',
 			)
 		);
 
@@ -746,7 +747,7 @@
 		 */
 		$some_non_rendered_areas_messages    = array();
 		$some_non_rendered_areas_messages[1] = html_entity_decode(
-			__( 'Your theme has 1 other widget area, but this particular page doesn’t display it.' ),
+			__( 'Your theme has 1 other widget area, but this particular page does not display it.' ),
 			ENT_QUOTES,
 			get_bloginfo( 'charset' )
 		);
@@ -756,8 +757,8 @@
 				sprintf(
 					/* translators: %s: The number of other widget areas registered but not rendered. */
 					_n(
-						'Your theme has %s other widget area, but this particular page doesn’t display it.',
-						'Your theme has %s other widget areas, but this particular page doesn’t display them.',
+						'Your theme has %s other widget area, but this particular page does not display it.',
+						'Your theme has %s other widget areas, but this particular page does not display them.',
 						$non_rendered_count
 					),
 					number_format_i18n( $non_rendered_count )
@@ -770,7 +771,7 @@
 		if ( 1 === $registered_sidebar_count ) {
 			$no_areas_shown_message = html_entity_decode(
 				sprintf(
-					__( 'Your theme has 1 widget area, but this particular page doesn’t display it.' )
+					__( 'Your theme has 1 widget area, but this particular page does not display it.' )
 				),
 				ENT_QUOTES,
 				get_bloginfo( 'charset' )
@@ -780,8 +781,8 @@
 				sprintf(
 					/* translators: %s: The total number of widget areas registered. */
 					_n(
-						'Your theme has %s widget area, but this particular page doesn’t display it.',
-						'Your theme has %s widget areas, but this particular page doesn’t display them.',
+						'Your theme has %s widget area, but this particular page does not display it.',
+						'Your theme has %s widget areas, but this particular page does not display them.',
 						$registered_sidebar_count
 					),
 					number_format_i18n( $registered_sidebar_count )
@@ -837,7 +838,11 @@
 		 */
 
 		if ( wp_use_widgets_block_editor() ) {
-			$block_editor_context = new WP_Block_Editor_Context();
+			$block_editor_context = new WP_Block_Editor_Context(
+				array(
+					'name' => 'core/customize-widgets',
+				)
+			);
 
 			$editor_settings = get_block_editor_settings(
 				get_legacy_widget_block_editor_settings(),
@@ -1421,9 +1426,8 @@
 			if ( ! empty( $widget_object->widget_options['show_instance_in_rest'] ) ) {
 				if ( 'block' === $id_base && ! current_user_can( 'unfiltered_html' ) ) {
 					/*
-					 * The content of the 'block' widget is not filtered on the
-					 * fly while editing. Filter the content here to prevent
-					 * vulnerabilities.
+					 * The content of the 'block' widget is not filtered on the fly while editing.
+					 * Filter the content here to prevent vulnerabilities.
 					 */
 					$value['raw_instance']['content'] = wp_kses_post( $value['raw_instance']['content'] );
 				}
@@ -2053,15 +2057,15 @@
 	 *
 	 * @since 4.2.0
 	 *
-	 * @param string $option_name Option name.
-	 * @param mixed  $default     Optional. Default value to return if the option does not exist. Default false.
+	 * @param string $option_name   Option name.
+	 * @param mixed  $default_value Optional. Default value to return if the option does not exist. Default false.
 	 * @return mixed Value set for the option.
 	 */
-	protected function get_captured_option( $option_name, $default = false ) {
+	protected function get_captured_option( $option_name, $default_value = false ) {
 		if ( array_key_exists( $option_name, $this->_captured_options ) ) {
 			$value = $this->_captured_options[ $option_name ];
 		} else {
-			$value = $default;
+			$value = $default_value;
 		}
 		return $value;
 	}