[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

Widget API: WP_Widget_Text class

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

Defines 1 class

WP_Widget_Text:: (11 methods):
  __construct()
  _register_one()
  is_legacy_instance()
  _filter_gallery_shortcode_attrs()
  widget()
  inject_video_max_width_style()
  update()
  enqueue_preview_scripts()
  enqueue_admin_scripts()
  form()
  render_control_template_scripts()


Class: WP_Widget_Text  - X-Ref

Core class used to implement a Text widget.

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

since: 2.8.0

_register_one( $number = -1 )   X-Ref
Add hooks for enqueueing assets when registering all widget instances of this widget class.

param: integer $number Optional. The unique order number of this widget instance

is_legacy_instance( $instance )   X-Ref
Determines whether a given instance is legacy and should bypass using TinyMCE.

return: bool Whether Text widget instance contains legacy data.
param: array $instance {
since: 4.8.1

_filter_gallery_shortcode_attrs( $attrs )   X-Ref
Filter gallery shortcode attributes.

Prevents all of a site's attachments from being shown in a gallery displayed on a
non-singular template where a $post context is not available.

return: array Attributes.
param: array $attrs Attributes.
since: 4.9.0

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

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

inject_video_max_width_style( $matches )   X-Ref
Inject max-width and remove height for videos too constrained to fit inside sidebars on frontend.

return: string HTML Output.
param: array $matches Pattern matches from preg_replace_callback.
since: 4.9.0

update( $new_instance, $old_instance )   X-Ref
Handles updating settings for the current Text 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: 2.8.0

enqueue_preview_scripts()   X-Ref
Enqueue preview scripts.

These scripts normally are enqueued just-in-time when a playlist shortcode is used.
However, in the customizer, a playlist shortcode may be used in a text widget and
dynamically added via selective refresh, so it is important to unconditionally enqueue them.

since: 4.9.3

enqueue_admin_scripts()   X-Ref
Loads the required scripts and styles for the widget control.

since: 4.8.0

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

return: void
param: array $instance Current settings.
since: 2.8.0
since: 4.8.0 Form only contains hidden inputs which are synced with JS template.
since: 4.8.1 Restored original form to be displayed when in legacy mode.

render_control_template_scripts()   X-Ref
Render form template scripts.

since: 4.8.0
since: 4.9.0 The method is now static.



Generated: Sat Sep 21 01:00:03 2019 Cross-referenced by PHPXref 0.7.1