Improve inline documentation for four methods in `WP_Widget`: `get_field_id()`, `display_callback()`, `update_callback()`, and `form_callback()`.
Props jazzs3quence for the initial patch. See #30315. Built from https://develop.svn.wordpress.org/trunk@30691 git-svn-id: http://core.svn.wordpress.org/trunk@30681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4c86797ba7
commit
4bdf9961d4
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.1-beta2-30690';
|
$wp_version = '4.1-beta2-30691';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
|
@ -132,12 +132,16 @@ class WP_Widget {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs id attributes for use in form() fields
|
* Constructs id attributes for use in {@see WP_Widget::form()} fields.
|
||||||
*
|
*
|
||||||
* This function should be used in form() methods to create id attributes for fields to be saved by update()
|
* This function should be used in form() methods to create id attributes
|
||||||
|
* for fields to be saved by {@see WP_Widget::update()}.
|
||||||
*
|
*
|
||||||
* @param string $field_name Field name
|
* @since 2.8.0
|
||||||
* @return string ID attribute for $field_name
|
* @access public
|
||||||
|
*
|
||||||
|
* @param string $field_name Field name.
|
||||||
|
* @return string ID attribute for `$field_name`.
|
||||||
*/
|
*/
|
||||||
public function get_field_id( $field_name ) {
|
public function get_field_id( $field_name ) {
|
||||||
return 'widget-' . $this->id_base . '-' . $this->number . '-' . $field_name;
|
return 'widget-' . $this->id_base . '-' . $this->number . '-' . $field_name;
|
||||||
|
@ -220,6 +224,7 @@ class WP_Widget {
|
||||||
*
|
*
|
||||||
* Finds the instance and calls {@see WP_Widget::widget()}.
|
* Finds the instance and calls {@see WP_Widget::widget()}.
|
||||||
*
|
*
|
||||||
|
* @since 2.8.0
|
||||||
* @access public
|
* @access public
|
||||||
*
|
*
|
||||||
* @param array $args Display arguments. See {@see WP_Widget::widget()} for information
|
* @param array $args Display arguments. See {@see WP_Widget::widget()} for information
|
||||||
|
@ -273,9 +278,10 @@ class WP_Widget {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deal with changed settings.
|
* Deal with changed settings (Do NOT override).
|
||||||
*
|
*
|
||||||
* Do NOT over-ride this function.
|
* @since 2.8.0
|
||||||
|
* @access public
|
||||||
*
|
*
|
||||||
* @param int $deprecated Not used.
|
* @param int $deprecated Not used.
|
||||||
*/
|
*/
|
||||||
|
@ -355,9 +361,12 @@ class WP_Widget {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate the control form.
|
* Generate the widget control form (Do NOT override).
|
||||||
*
|
*
|
||||||
* Do NOT over-ride this function.
|
* @since 2.8.0
|
||||||
|
* @access public
|
||||||
|
*
|
||||||
|
* @param int|array $widget_args Widget instance number or array of widget arguments.
|
||||||
*/
|
*/
|
||||||
public function form_callback( $widget_args = 1 ) {
|
public function form_callback( $widget_args = 1 ) {
|
||||||
if ( is_numeric($widget_args) )
|
if ( is_numeric($widget_args) )
|
||||||
|
|
Loading…
Reference in New Issue