[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/widgets/ -> class-wp-widget-block.php (summary)

Widget API: WP_Widget_Block class

File Size: 232 lines (7 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_Widget_Block:: (6 methods):
  __construct()
  widget()
  get_dynamic_classname()
  update()
  form()
  set_is_wide_widget_in_customizer()


Class: WP_Widget_Block  - X-Ref

Core class used to implement a Block widget.

__construct()   X-Ref
Sets up a new Block widget instance.

since: 5.8.0

widget( $args, $instance )   X-Ref
Outputs the content for the current Block widget instance.

param: array $args     Display arguments including 'before_title', 'after_title',
param: array $instance Settings for the current Block widget instance.
since: 5.8.0

get_dynamic_classname( $content )   X-Ref
Calculates the classname to use in the block widget's container HTML.

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.

If a block widget contains a block that has an equivalent legacy widget,
we display that legacy widget's class name. This helps with theme
backwards compatibility.

return: string The classname to use in the block widget's container HTML.
param: string $content The HTML content of the current block widget.
since: 5.8.0

update( $new_instance, $old_instance )   X-Ref
Handles updating settings for the current Block widget instance.

return: array Settings to save or bool false to cancel saving.
param: array $new_instance New settings for this instance as input by the user via
param: array $old_instance Old settings for this instance.
since: 5.8.0

form( $instance )   X-Ref
Outputs the Block widget settings form.

param: array $instance Current instance.
since: 5.8.0

set_is_wide_widget_in_customizer( $is_wide, $widget_id )   X-Ref
Makes sure no block widget is considered to be wide.

return: bool Updated `is_wide` value.
param: bool   $is_wide   Whether the widget is considered wide.
param: string $widget_id Widget ID.
since: 5.8.0



Generated: Thu Nov 21 01:00:03 2024 Cross-referenced by PHPXref 0.7.1