X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/784f914b1e4b1c62d6657e86397c2e83bcee4295..16e7b37c7914d753890c1a05a9335f3b43751eb8:/wp-includes/class-wp-widget.php?ds=sidebyside diff --git a/wp-includes/class-wp-widget.php b/wp-includes/class-wp-widget.php index 9b9e4725..b69b219c 100644 --- a/wp-includes/class-wp-widget.php +++ b/wp-includes/class-wp-widget.php @@ -10,8 +10,9 @@ /** * Core base class extended to register widgets. * - * This class must be extended for each widget and WP_Widget::widget(), WP_Widget::update() - * and WP_Widget::form() need to be overridden. + * This class must be extended for each widget, and WP_Widget::widget() must be overridden. + * + * If adding widget options, WP_Widget::update() and WP_Widget::form() should also be overridden. * * @since 2.8.0 * @since 4.4.0 Moved to its own file from wp-includes/widgets.php @@ -36,6 +37,24 @@ class WP_Widget { */ public $name; + /** + * Option name for this widget type. + * + * @since 2.8.0 + * @access public + * @var string + */ + public $option_name; + + /** + * Alt option name for this widget type. + * + * @since 2.8.0 + * @access public + * @var string + */ + public $alt_option_name; + /** * Option array passed to wp_register_sidebar_widget(). * @@ -85,7 +104,7 @@ class WP_Widget { public $updated = false; // - // Member functions that must be overriden by subclasses. + // Member functions that must be overridden by subclasses. // /** @@ -168,7 +187,7 @@ class WP_Widget { * @access public * * @see __construct() - * + * * @param string $id_base Optional Base ID for the widget, lowercase and unique. If left empty, * a portion of the widget's class name will be used Has to be unique. * @param string $name Name for the widget displayed on the configuration page. @@ -352,7 +371,7 @@ class WP_Widget { $instance = $instances[ $this->number ]; /** - * Filter the settings for a particular widget instance. + * Filters the settings for a particular widget instance. * * Returning false will effectively short-circuit display of the widget. * @@ -441,7 +460,7 @@ class WP_Widget { } /** - * Filter a widget's settings before saving. + * Filters a widget's settings before saving. * * Returning false will effectively short-circuit the widget's ability * to update settings. @@ -497,7 +516,7 @@ class WP_Widget { } /** - * Filter the widget instance's settings before displaying the control form. + * Filters the widget instance's settings before displaying the control form. * * Returning false effectively short-circuits display of the control form. *