Add missing doc blocks to `widgets.php`.
Cleanup `@return` values. See #32444. Built from https://develop.svn.wordpress.org/trunk@32639 git-svn-id: http://core.svn.wordpress.org/trunk@32609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b1c2305aa1
commit
bece996d45
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.3-alpha-32638';
|
$wp_version = '4.3-alpha-32639';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
|
|
|
@ -250,14 +250,21 @@ class WP_Widget {
|
||||||
$this->id = $this->id_base . '-' . $number;
|
$this->id = $this->id_base . '-' . $number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return callback
|
||||||
|
*/
|
||||||
public function _get_display_callback() {
|
public function _get_display_callback() {
|
||||||
return array($this, 'display_callback');
|
return array($this, 'display_callback');
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @return callback
|
||||||
|
*/
|
||||||
public function _get_update_callback() {
|
public function _get_update_callback() {
|
||||||
return array($this, 'update_callback');
|
return array($this, 'update_callback');
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @return callback
|
||||||
|
*/
|
||||||
public function _get_form_callback() {
|
public function _get_form_callback() {
|
||||||
return array($this, 'form_callback');
|
return array($this, 'form_callback');
|
||||||
}
|
}
|
||||||
|
@ -273,6 +280,8 @@ class WP_Widget {
|
||||||
* @since 3.9.0
|
* @since 3.9.0
|
||||||
* @access public
|
* @access public
|
||||||
*
|
*
|
||||||
|
* @global WP_Customize_Manager $wp_customize
|
||||||
|
*
|
||||||
* @return bool True if within the Customizer preview, false if not.
|
* @return bool True if within the Customizer preview, false if not.
|
||||||
*/
|
*/
|
||||||
public function is_preview() {
|
public function is_preview() {
|
||||||
|
@ -345,6 +354,8 @@ class WP_Widget {
|
||||||
* @since 2.8.0
|
* @since 2.8.0
|
||||||
* @access public
|
* @access public
|
||||||
*
|
*
|
||||||
|
* @global array $wp_registered_widgets
|
||||||
|
*
|
||||||
* @param int $deprecated Not used.
|
* @param int $deprecated Not used.
|
||||||
*/
|
*/
|
||||||
public function update_callback( $deprecated = 1 ) {
|
public function update_callback( $deprecated = 1 ) {
|
||||||
|
@ -585,6 +596,8 @@ class WP_Widget_Factory {
|
||||||
*
|
*
|
||||||
* @since 2.8.0
|
* @since 2.8.0
|
||||||
* @access public
|
* @access public
|
||||||
|
*
|
||||||
|
* @global array $wp_registered_widgets
|
||||||
*/
|
*/
|
||||||
public function _register_widgets() {
|
public function _register_widgets() {
|
||||||
global $wp_registered_widgets;
|
global $wp_registered_widgets;
|
||||||
|
@ -632,15 +645,22 @@ $wp_registered_widgets = array();
|
||||||
* @since 2.2.0
|
* @since 2.2.0
|
||||||
*/
|
*/
|
||||||
$wp_registered_widget_controls = array();
|
$wp_registered_widget_controls = array();
|
||||||
|
/**
|
||||||
|
* @global array $wp_registered_widget_updates
|
||||||
|
*/
|
||||||
$wp_registered_widget_updates = array();
|
$wp_registered_widget_updates = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private
|
* Private
|
||||||
|
*
|
||||||
|
* @global array $_wp_sidebars_widgets
|
||||||
*/
|
*/
|
||||||
$_wp_sidebars_widgets = array();
|
$_wp_sidebars_widgets = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private
|
* Private
|
||||||
|
*
|
||||||
|
* @global array $_wp_deprecated_widgets_callbacks
|
||||||
*/
|
*/
|
||||||
$GLOBALS['_wp_deprecated_widgets_callbacks'] = array(
|
$GLOBALS['_wp_deprecated_widgets_callbacks'] = array(
|
||||||
'wp_widget_pages',
|
'wp_widget_pages',
|
||||||
|
@ -677,8 +697,8 @@ $GLOBALS['_wp_deprecated_widgets_callbacks'] = array(
|
||||||
* @since 2.8.0
|
* @since 2.8.0
|
||||||
*
|
*
|
||||||
* @see WP_Widget
|
* @see WP_Widget
|
||||||
* @see WP_Widget_Factory
|
*
|
||||||
* @uses WP_Widget_Factory
|
* @global WP_Widget_Factory $wp_widget_factory
|
||||||
*
|
*
|
||||||
* @param string $widget_class The name of a class that extends WP_Widget
|
* @param string $widget_class The name of a class that extends WP_Widget
|
||||||
*/
|
*/
|
||||||
|
@ -697,8 +717,8 @@ function register_widget($widget_class) {
|
||||||
* @since 2.8.0
|
* @since 2.8.0
|
||||||
*
|
*
|
||||||
* @see WP_Widget
|
* @see WP_Widget
|
||||||
* @see WP_Widget_Factory
|
*
|
||||||
* @uses WP_Widget_Factory
|
* @global WP_Widget_Factory $wp_widget_factory
|
||||||
*
|
*
|
||||||
* @param string $widget_class The name of a class that extends WP_Widget
|
* @param string $widget_class The name of a class that extends WP_Widget
|
||||||
*/
|
*/
|
||||||
|
@ -719,6 +739,8 @@ function unregister_widget($widget_class) {
|
||||||
*
|
*
|
||||||
* @see register_sidebar() The second parameter is documented by register_sidebar() and is the same here.
|
* @see register_sidebar() The second parameter is documented by register_sidebar() and is the same here.
|
||||||
*
|
*
|
||||||
|
* @global array $wp_registered_sidebars
|
||||||
|
*
|
||||||
* @param int $number Optional. Number of sidebars to create. Default 1.
|
* @param int $number Optional. Number of sidebars to create. Default 1.
|
||||||
* @param array|string $args {
|
* @param array|string $args {
|
||||||
* Optional. Array or string of arguments for building a sidebar.
|
* Optional. Array or string of arguments for building a sidebar.
|
||||||
|
@ -851,7 +873,7 @@ function register_sidebar($args = array()) {
|
||||||
*
|
*
|
||||||
* @since 2.2.0
|
* @since 2.2.0
|
||||||
*
|
*
|
||||||
* @uses $wp_registered_sidebars Stores the new sidebar in this array by sidebar ID.
|
* @global array $wp_registered_sidebars Stores the new sidebar in this array by sidebar ID.
|
||||||
*
|
*
|
||||||
* @param string $name The ID of the sidebar when it was added.
|
* @param string $name The ID of the sidebar when it was added.
|
||||||
*/
|
*/
|
||||||
|
@ -873,6 +895,8 @@ function unregister_sidebar( $name ) {
|
||||||
*
|
*
|
||||||
* @global array $wp_registered_widgets Uses stored registered widgets.
|
* @global array $wp_registered_widgets Uses stored registered widgets.
|
||||||
* @global array $wp_register_widget_defaults Retrieves widget defaults.
|
* @global array $wp_register_widget_defaults Retrieves widget defaults.
|
||||||
|
* @global array $wp_registered_widget_updates
|
||||||
|
* @global array $_wp_deprecated_widgets_callbacks
|
||||||
*
|
*
|
||||||
* @param int|string $id Widget ID.
|
* @param int|string $id Widget ID.
|
||||||
* @param string $name Widget display title.
|
* @param string $name Widget display title.
|
||||||
|
@ -885,7 +909,6 @@ function unregister_sidebar( $name ) {
|
||||||
* @type string $description Widget description for display in the widget administration
|
* @type string $description Widget description for display in the widget administration
|
||||||
* panel and/or theme.
|
* panel and/or theme.
|
||||||
* }
|
* }
|
||||||
* @return null Will return if `$output_callback` is empty after removing widget.
|
|
||||||
*/
|
*/
|
||||||
function wp_register_sidebar_widget( $id, $name, $output_callback, $options = array() ) {
|
function wp_register_sidebar_widget( $id, $name, $output_callback, $options = array() ) {
|
||||||
global $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_updates, $_wp_deprecated_widgets_callbacks;
|
global $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_updates, $_wp_deprecated_widgets_callbacks;
|
||||||
|
@ -937,8 +960,10 @@ function wp_register_sidebar_widget( $id, $name, $output_callback, $options = ar
|
||||||
*
|
*
|
||||||
* @since 2.5.0
|
* @since 2.5.0
|
||||||
*
|
*
|
||||||
|
* @global array $wp_registered_widgets
|
||||||
|
*
|
||||||
* @param int|string $id Widget ID.
|
* @param int|string $id Widget ID.
|
||||||
* @return string Widget description, if available. Null on failure to retrieve description.
|
* @return string|void Widget description, if available.
|
||||||
*/
|
*/
|
||||||
function wp_widget_description( $id ) {
|
function wp_widget_description( $id ) {
|
||||||
if ( !is_scalar($id) )
|
if ( !is_scalar($id) )
|
||||||
|
@ -958,8 +983,10 @@ function wp_widget_description( $id ) {
|
||||||
*
|
*
|
||||||
* @since 2.9.0
|
* @since 2.9.0
|
||||||
*
|
*
|
||||||
|
* @global array $wp_registered_sidebars
|
||||||
|
*
|
||||||
* @param string $id sidebar ID.
|
* @param string $id sidebar ID.
|
||||||
* @return string Sidebar description, if available. Null on failure to retrieve description.
|
* @return string|void Sidebar description, if available.
|
||||||
*/
|
*/
|
||||||
function wp_sidebar_description( $id ) {
|
function wp_sidebar_description( $id ) {
|
||||||
if ( !is_scalar($id) )
|
if ( !is_scalar($id) )
|
||||||
|
@ -1008,6 +1035,11 @@ function wp_unregister_sidebar_widget($id) {
|
||||||
* @todo Document `$options` as a hash notation, re: WP_Widget::__construct() cross-reference.
|
* @todo Document `$options` as a hash notation, re: WP_Widget::__construct() cross-reference.
|
||||||
* @todo `$params` parameter?
|
* @todo `$params` parameter?
|
||||||
*
|
*
|
||||||
|
* @global array $wp_registered_widget_controls
|
||||||
|
* @global array $wp_registered_widget_updates
|
||||||
|
* @global array $wp_registered_widgets
|
||||||
|
* @global array $_wp_deprecated_widgets_callbacks
|
||||||
|
*
|
||||||
* @param int|string $id Sidebar ID.
|
* @param int|string $id Sidebar ID.
|
||||||
* @param string $name Sidebar display name.
|
* @param string $name Sidebar display name.
|
||||||
* @param callback $control_callback Run when sidebar is displayed.
|
* @param callback $control_callback Run when sidebar is displayed.
|
||||||
|
@ -1059,8 +1091,8 @@ function wp_register_widget_control( $id, $name, $control_callback, $options = a
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @global array $wp_registered_widget_updates
|
* @global array $wp_registered_widget_updates
|
||||||
|
*
|
||||||
* @param string $id_base
|
* @param string $id_base
|
||||||
* @param callable $update_callback
|
* @param callable $update_callback
|
||||||
* @param array $options
|
* @param array $options
|
||||||
|
@ -1086,11 +1118,11 @@ function _register_widget_update_callback($id_base, $update_callback, $options =
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @global array $wp_registered_widget_controls
|
* @global array $wp_registered_widget_controls
|
||||||
|
*
|
||||||
* @param int|string $id
|
* @param int|string $id
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @param callable $form_callback
|
* @param callable $form_callback
|
||||||
* @param array $options
|
* @param array $options
|
||||||
* @return null
|
|
||||||
*/
|
*/
|
||||||
function _register_widget_form_callback($id, $name, $form_callback, $options = array()) {
|
function _register_widget_form_callback($id, $name, $form_callback, $options = array()) {
|
||||||
global $wp_registered_widget_controls;
|
global $wp_registered_widget_controls;
|
||||||
|
@ -1129,7 +1161,7 @@ function _register_widget_form_callback($id, $name, $form_callback, $options = a
|
||||||
* @param int|string $id Widget ID.
|
* @param int|string $id Widget ID.
|
||||||
*/
|
*/
|
||||||
function wp_unregister_widget_control($id) {
|
function wp_unregister_widget_control($id) {
|
||||||
return wp_register_widget_control($id, '', '');
|
wp_register_widget_control( $id, '', '' );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1141,6 +1173,9 @@ function wp_unregister_widget_control($id) {
|
||||||
*
|
*
|
||||||
* @since 2.2.0
|
* @since 2.2.0
|
||||||
*
|
*
|
||||||
|
* @global array $wp_registered_sidebars
|
||||||
|
* @global array $wp_registered_widgets
|
||||||
|
*
|
||||||
* @param int|string $index Optional, default is 1. Index, name or ID of dynamic sidebar.
|
* @param int|string $index Optional, default is 1. Index, name or ID of dynamic sidebar.
|
||||||
* @return bool True, if widget sidebar was found and called. False if not found or not called.
|
* @return bool True, if widget sidebar was found and called. False if not found or not called.
|
||||||
*/
|
*/
|
||||||
|
@ -1300,10 +1335,7 @@ function dynamic_sidebar($index = 1) {
|
||||||
* Default false.
|
* Default false.
|
||||||
* @param int|string $index Index, name, or ID of the dynamic sidebar.
|
* @param int|string $index Index, name, or ID of the dynamic sidebar.
|
||||||
*/
|
*/
|
||||||
|
return apply_filters( 'dynamic_sidebar_has_widgets', $did_one, $index );
|
||||||
$did_one = apply_filters( 'dynamic_sidebar_has_widgets', $did_one, $index );
|
|
||||||
|
|
||||||
return $did_one;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1321,11 +1353,13 @@ function dynamic_sidebar($index = 1) {
|
||||||
*
|
*
|
||||||
* @since 2.2.0
|
* @since 2.2.0
|
||||||
*
|
*
|
||||||
* @param string $callback Optional, Widget callback to check.
|
* @global array $wp_registered_widgets
|
||||||
* @param int $widget_id Optional, but needed for checking. Widget ID.
|
*
|
||||||
* @param string $id_base Optional, the base ID of a widget created by extending WP_Widget.
|
* @param string $callback Optional, Widget callback to check.
|
||||||
* @param bool $skip_inactive Optional, whether to check in 'wp_inactive_widgets'.
|
* @param int $widget_id Optional, but needed for checking. Widget ID.
|
||||||
* @return mixed false if widget is not active or id of sidebar in which the widget is active.
|
* @param string $id_base Optional, the base ID of a widget created by extending WP_Widget.
|
||||||
|
* @param bool $skip_inactive Optional, whether to check in 'wp_inactive_widgets'.
|
||||||
|
* @return string|false False if widget is not active or id of sidebar in which the widget is active.
|
||||||
*/
|
*/
|
||||||
function is_active_widget($callback = false, $widget_id = false, $id_base = false, $skip_inactive = true) {
|
function is_active_widget($callback = false, $widget_id = false, $id_base = false, $skip_inactive = true) {
|
||||||
global $wp_registered_widgets;
|
global $wp_registered_widgets;
|
||||||
|
@ -1356,6 +1390,9 @@ function is_active_widget($callback = false, $widget_id = false, $id_base = fals
|
||||||
*
|
*
|
||||||
* @since 2.2.0
|
* @since 2.2.0
|
||||||
*
|
*
|
||||||
|
* @global array $wp_registered_widgets
|
||||||
|
* @global array $wp_registered_sidebars
|
||||||
|
*
|
||||||
* @return bool True, if using widgets. False, if not using widgets.
|
* @return bool True, if using widgets. False, if not using widgets.
|
||||||
*/
|
*/
|
||||||
function is_dynamic_sidebar() {
|
function is_dynamic_sidebar() {
|
||||||
|
@ -1407,6 +1444,9 @@ function is_active_sidebar( $index ) {
|
||||||
* @since 2.2.0
|
* @since 2.2.0
|
||||||
* @access private
|
* @access private
|
||||||
*
|
*
|
||||||
|
* @global array $_wp_sidebars_widgets
|
||||||
|
* @global array $sidebars_widgets
|
||||||
|
*
|
||||||
* @param bool $deprecated Not used (argument deprecated).
|
* @param bool $deprecated Not used (argument deprecated).
|
||||||
* @return array Upgraded list of widgets to version 3 array format when called from the admin.
|
* @return array Upgraded list of widgets to version 3 array format when called from the admin.
|
||||||
*/
|
*/
|
||||||
|
@ -1437,8 +1477,7 @@ function wp_get_sidebars_widgets( $deprecated = true ) {
|
||||||
*
|
*
|
||||||
* @param array $sidebars_widgets An associative array of sidebars and their widgets.
|
* @param array $sidebars_widgets An associative array of sidebars and their widgets.
|
||||||
*/
|
*/
|
||||||
$sidebars_widgets = apply_filters( 'sidebars_widgets', $sidebars_widgets );
|
return apply_filters( 'sidebars_widgets', $sidebars_widgets );
|
||||||
return $sidebars_widgets;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1461,6 +1500,8 @@ function wp_set_sidebars_widgets( $sidebars_widgets ) {
|
||||||
* @since 2.2.0
|
* @since 2.2.0
|
||||||
* @access private
|
* @access private
|
||||||
*
|
*
|
||||||
|
* @global array $wp_registered_sidebars
|
||||||
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function wp_get_widget_defaults() {
|
function wp_get_widget_defaults() {
|
||||||
|
@ -1479,6 +1520,8 @@ function wp_get_widget_defaults() {
|
||||||
*
|
*
|
||||||
* @since 2.8.0
|
* @since 2.8.0
|
||||||
*
|
*
|
||||||
|
* @global array $_wp_sidebars_widgets
|
||||||
|
*
|
||||||
* @param string $base_name
|
* @param string $base_name
|
||||||
* @param string $option_name
|
* @param string $option_name
|
||||||
* @param array $settings
|
* @param array $settings
|
||||||
|
@ -1540,6 +1583,8 @@ function wp_convert_widget_settings($base_name, $option_name, $settings) {
|
||||||
*
|
*
|
||||||
* @since 2.8.0
|
* @since 2.8.0
|
||||||
*
|
*
|
||||||
|
* @global WP_Widget_Factory $wp_widget_factory
|
||||||
|
*
|
||||||
* @param string $widget The widget's PHP class name (see default-widgets.php).
|
* @param string $widget The widget's PHP class name (see default-widgets.php).
|
||||||
* @param array $instance Optional. The widget's instance settings. Default empty array.
|
* @param array $instance Optional. The widget's instance settings. Default empty array.
|
||||||
* @param array $args {
|
* @param array $args {
|
||||||
|
@ -1586,6 +1631,8 @@ function the_widget( $widget, $instance = array(), $args = array() ) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private
|
* Private
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
function _get_widget_id_base($id) {
|
function _get_widget_id_base($id) {
|
||||||
return preg_replace( '/-[0-9]+$/', '', $id );
|
return preg_replace( '/-[0-9]+$/', '', $id );
|
||||||
|
@ -1596,6 +1643,8 @@ function _get_widget_id_base($id) {
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
* @since 3.3.0
|
* @since 3.3.0
|
||||||
|
*
|
||||||
|
* @global array $sidebars_widgets
|
||||||
*/
|
*/
|
||||||
function _wp_sidebars_changed() {
|
function _wp_sidebars_changed() {
|
||||||
global $sidebars_widgets;
|
global $sidebars_widgets;
|
||||||
|
@ -1611,9 +1660,13 @@ function _wp_sidebars_changed() {
|
||||||
*
|
*
|
||||||
* @since 2.8.0
|
* @since 2.8.0
|
||||||
*
|
*
|
||||||
|
* @global array $wp_registered_sidebars
|
||||||
|
* @global array $sidebars_widgets
|
||||||
|
* @global array $wp_registered_widgets
|
||||||
|
*
|
||||||
* @param string|bool $theme_changed Whether the theme was changed as a boolean. A value
|
* @param string|bool $theme_changed Whether the theme was changed as a boolean. A value
|
||||||
* of 'customize' defers updates for the Customizer.
|
* of 'customize' defers updates for the Customizer.
|
||||||
* @return array
|
* @return array|void
|
||||||
*/
|
*/
|
||||||
function retrieve_widgets( $theme_changed = false ) {
|
function retrieve_widgets( $theme_changed = false ) {
|
||||||
global $wp_registered_sidebars, $sidebars_widgets, $wp_registered_widgets;
|
global $wp_registered_sidebars, $sidebars_widgets, $wp_registered_widgets;
|
||||||
|
|
Loading…
Reference in New Issue