From 6311baa859e0a3d7b48ed8cf518d9f6cfe9a613e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 28 Jun 2021 08:35:57 +0000 Subject: [PATCH] Docs: Update documentation for `WP_Widget_Block` per the documentation standards. Remove unused `$post` global reference. Follow-up to [50995], [51058], [51063], [51221]. See #52628, #53461. Built from https://develop.svn.wordpress.org/trunk@51249 git-svn-id: http://core.svn.wordpress.org/trunk@50858 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- wp-includes/widgets/class-wp-widget-block.php | 25 ++++++++----------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index d6c0145ba8..eb55728963 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-beta4-51248'; +$wp_version = '5.8-beta4-51249'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/widgets/class-wp-widget-block.php b/wp-includes/widgets/class-wp-widget-block.php index 35a2c966e5..8d322ef4e7 100644 --- a/wp-includes/widgets/class-wp-widget-block.php +++ b/wp-includes/widgets/class-wp-widget-block.php @@ -43,6 +43,7 @@ class WP_Widget_Block extends WP_Widget { 'height' => 350, ); parent::__construct( 'block', __( 'Block' ), $widget_ops, $control_ops ); + add_filter( 'is_wide_widget_in_customizer', array( $this, 'set_is_wide_widget_in_customizer' ), 10, 2 ); } @@ -54,8 +55,6 @@ class WP_Widget_Block extends WP_Widget { * @param array $args Display arguments including 'before_title', 'after_title', * 'before_widget', and 'after_widget'. * @param array $instance Settings for the current Block widget instance. - * - * @global WP_Post $post Global post object. */ public function widget( $args, $instance ) { $instance = wp_parse_args( $instance, $this->default_instance ); @@ -88,7 +87,7 @@ class WP_Widget_Block extends WP_Widget { /** * Calculates the classname to use in the block widget's container HTML. * - * Usually this is set to $this->widget_options['classname'] by + * Usually this is set to `$this->widget_options['classname']` by * dynamic_sidebar(). In this case, however, we want to set the classname * dynamically depending on the block contained by this block widget. * @@ -99,7 +98,6 @@ class WP_Widget_Block extends WP_Widget { * @since 5.8.0 * * @param string $content The HTML content of the current block widget. - * * @return string The classname to use in the block widget's container HTML. */ private function get_dynamic_classname( $content ) { @@ -157,13 +155,14 @@ class WP_Widget_Block extends WP_Widget { /** * The classname used in the block widget's container HTML. * - * This can be set according to the name of the block contained by the - * block widget. + * This can be set according to the name of the block contained by the block widget. * * @since 5.8.0 * - * @param string $classname The classname to be used in the block widget's container HTML, e.g. 'widget_block widget_text'. - * @param string $block_name The name of the block contained by the block widget, e.g. 'core/paragraph'. + * @param string $classname The classname to be used in the block widget's container HTML, + * e.g. 'widget_block widget_text'. + * @param string $block_name The name of the block contained by the block widget, + * e.g. 'core/paragraph'. */ return apply_filters( 'widget_block_dynamic_classname', $classname, $block_name ); } @@ -176,7 +175,6 @@ class WP_Widget_Block extends WP_Widget { * @param array $new_instance New settings for this instance as input by the user via * WP_Widget::form(). * @param array $old_instance Old settings for this instance. - * * @return array Settings to save or bool false to cancel saving. */ public function update( $new_instance, $old_instance ) { @@ -206,14 +204,13 @@ class WP_Widget_Block extends WP_Widget { } /** - * Make sure no block widget is considered to be wide. + * Makes sure no block widget is considered to be wide. * * @since 5.8.0 * - * @param boolean $is_wide Is regarded wide. - * @param string $widget_id Widget ID. - * - * @return bool Updated is_wide value. + * @param bool $is_wide Whether the widget is considered wide. + * @param string $widget_id Widget ID. + * @return bool Updated `is_wide` value. */ public function set_is_wide_widget_in_customizer( $is_wide, $widget_id ) { if ( strpos( $widget_id, 'block-' ) === 0 ) {