Make WordPress Core


Ignore:
Timestamp:
06/28/2021 08:34:18 AM (5 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/widgets/class-wp-widget-block.php

    r51221 r51249  
    4444                );
    4545                parent::__construct( 'block', __( 'Block' ), $widget_ops, $control_ops );
     46
    4647                add_filter( 'is_wide_widget_in_customizer', array( $this, 'set_is_wide_widget_in_customizer' ), 10, 2 );
    4748        }
     
    5556         *                        'before_widget', and 'after_widget'.
    5657         * @param array $instance Settings for the current Block widget instance.
    57          *
    58          * @global WP_Post $post Global post object.
    5958         */
    6059        public function widget( $args, $instance ) {
     
    8988         * Calculates the classname to use in the block widget's container HTML.
    9089         *
    91          * Usually this is set to $this->widget_options['classname'] by
     90         * Usually this is set to `$this->widget_options['classname']` by
    9291         * dynamic_sidebar(). In this case, however, we want to set the classname
    9392         * dynamically depending on the block contained by this block widget.
     
    10099         *
    101100         * @param string $content The HTML content of the current block widget.
    102          *
    103101         * @return string The classname to use in the block widget's container HTML.
    104102         */
     
    158156                 * The classname used in the block widget's container HTML.
    159157                 *
    160                  * This can be set according to the name of the block contained by the
    161                  * block widget.
     158                 * This can be set according to the name of the block contained by the block widget.
    162159                 *
    163160                 * @since 5.8.0
    164161                 *
    165                  * @param string $classname The classname to be used in the block widget's container HTML, e.g. 'widget_block widget_text'.
    166                  * @param string $block_name The name of the block contained by the block widget, e.g. 'core/paragraph'.
     162                 * @param string $classname  The classname to be used in the block widget's container HTML,
     163                 *                           e.g. 'widget_block widget_text'.
     164                 * @param string $block_name The name of the block contained by the block widget,
     165                 *                           e.g. 'core/paragraph'.
    167166                 */
    168167                return apply_filters( 'widget_block_dynamic_classname', $classname, $block_name );
     
    177176         *                            WP_Widget::form().
    178177         * @param array $old_instance Old settings for this instance.
    179          *
    180178         * @return array Settings to save or bool false to cancel saving.
    181179         */
     
    207205
    208206        /**
    209          * Make sure no block widget is considered to be wide.
    210          *
    211          * @since 5.8.0
    212          *
    213          * @param boolean $is_wide Is regarded wide.
    214          * @param string  $widget_id Widget ID.
    215          *
    216          * @return bool Updated is_wide value.
     207         * Makes sure no block widget is considered to be wide.
     208         *
     209         * @since 5.8.0
     210         *
     211         * @param bool   $is_wide   Whether the widget is considered wide.
     212         * @param string $widget_id Widget ID.
     213         * @return bool Updated `is_wide` value.
    217214         */
    218215        public function set_is_wide_widget_in_customizer( $is_wide, $widget_id ) {
Note: See TracChangeset for help on using the changeset viewer.