Changeset 51249
- Timestamp:
- 06/28/2021 08:34:18 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widgets/class-wp-widget-block.php
r51221 r51249 44 44 ); 45 45 parent::__construct( 'block', __( 'Block' ), $widget_ops, $control_ops ); 46 46 47 add_filter( 'is_wide_widget_in_customizer', array( $this, 'set_is_wide_widget_in_customizer' ), 10, 2 ); 47 48 } … … 55 56 * 'before_widget', and 'after_widget'. 56 57 * @param array $instance Settings for the current Block widget instance. 57 *58 * @global WP_Post $post Global post object.59 58 */ 60 59 public function widget( $args, $instance ) { … … 89 88 * Calculates the classname to use in the block widget's container HTML. 90 89 * 91 * Usually this is set to $this->widget_options['classname']by90 * Usually this is set to `$this->widget_options['classname']` by 92 91 * dynamic_sidebar(). In this case, however, we want to set the classname 93 92 * dynamically depending on the block contained by this block widget. … … 100 99 * 101 100 * @param string $content The HTML content of the current block widget. 102 *103 101 * @return string The classname to use in the block widget's container HTML. 104 102 */ … … 158 156 * The classname used in the block widget's container HTML. 159 157 * 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. 162 159 * 163 160 * @since 5.8.0 164 161 * 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'. 167 166 */ 168 167 return apply_filters( 'widget_block_dynamic_classname', $classname, $block_name ); … … 177 176 * WP_Widget::form(). 178 177 * @param array $old_instance Old settings for this instance. 179 *180 178 * @return array Settings to save or bool false to cancel saving. 181 179 */ … … 207 205 208 206 /** 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. 217 214 */ 218 215 public function set_is_wide_widget_in_customizer( $is_wide, $widget_id ) {
Note: See TracChangeset
for help on using the changeset viewer.