Make WordPress Core

Changeset 32639


Ignore:
Timestamp:
05/28/2015 04:19:51 PM (9 years ago)
Author:
wonderboymusic
Message:

Add missing doc blocks to widgets.php.
Cleanup @return values.

See #32444.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/widgets.php

    r32602 r32639  
    251251    }
    252252
     253    /**
     254     * @return callback
     255     */
    253256    public function _get_display_callback() {
    254257        return array($this, 'display_callback');
    255258    }
    256 
     259    /**
     260     * @return callback
     261     */
    257262    public function _get_update_callback() {
    258263        return array($this, 'update_callback');
    259264    }
    260 
     265    /**
     266     * @return callback
     267     */
    261268    public function _get_form_callback() {
    262269        return array($this, 'form_callback');
     
    273280     * @since 3.9.0
    274281     * @access public
     282     *
     283     * @global WP_Customize_Manager $wp_customize
    275284     *
    276285     * @return bool True if within the Customizer preview, false if not.
     
    345354     * @since 2.8.0
    346355     * @access public
     356     *
     357     * @global array $wp_registered_widgets
    347358     *
    348359     * @param int $deprecated Not used.
     
    586597     * @since 2.8.0
    587598     * @access public
     599     *
     600     * @global array $wp_registered_widgets
    588601     */
    589602    public function _register_widgets() {
     
    633646 */
    634647$wp_registered_widget_controls = array();
     648/**
     649 * @global array $wp_registered_widget_updates
     650 */
    635651$wp_registered_widget_updates = array();
    636652
    637653/**
    638654 * Private
     655 *
     656 * @global array $_wp_sidebars_widgets
    639657 */
    640658$_wp_sidebars_widgets = array();
     
    642660/**
    643661 * Private
     662 *
     663 * @global array $_wp_deprecated_widgets_callbacks
    644664 */
    645665$GLOBALS['_wp_deprecated_widgets_callbacks'] = array(
     
    678698 *
    679699 * @see WP_Widget
    680  * @see WP_Widget_Factory
    681  * @uses WP_Widget_Factory
     700 *
     701 * @global WP_Widget_Factory $wp_widget_factory
    682702 *
    683703 * @param string $widget_class The name of a class that extends WP_Widget
     
    698718 *
    699719 * @see WP_Widget
    700  * @see WP_Widget_Factory
    701  * @uses WP_Widget_Factory
     720 *
     721 * @global WP_Widget_Factory $wp_widget_factory
    702722 *
    703723 * @param string $widget_class The name of a class that extends WP_Widget
     
    719739 *
    720740 * @see register_sidebar() The second parameter is documented by register_sidebar() and is the same here.
     741 *
     742 * @global array $wp_registered_sidebars
    721743 *
    722744 * @param int          $number Optional. Number of sidebars to create. Default 1.
     
    852874 * @since 2.2.0
    853875 *
    854  * @uses $wp_registered_sidebars Stores the new sidebar in this array by sidebar ID.
     876 * @global array $wp_registered_sidebars Stores the new sidebar in this array by sidebar ID.
    855877 *
    856878 * @param string $name The ID of the sidebar when it was added.
     
    874896 * @global array $wp_registered_widgets       Uses stored registered widgets.
    875897 * @global array $wp_register_widget_defaults Retrieves widget defaults.
     898 * @global array $wp_registered_widget_updates
     899 * @global array $_wp_deprecated_widgets_callbacks
    876900 *
    877901 * @param int|string $id              Widget ID.
     
    886910 *                               panel and/or theme.
    887911 * }
    888  * @return null Will return if `$output_callback` is empty after removing widget.
    889912 */
    890913function wp_register_sidebar_widget( $id, $name, $output_callback, $options = array() ) {
     
    938961 * @since 2.5.0
    939962 *
     963 * @global array $wp_registered_widgets
     964 *
    940965 * @param int|string $id Widget ID.
    941  * @return string Widget description, if available. Null on failure to retrieve description.
     966 * @return string|void Widget description, if available.
    942967 */
    943968function wp_widget_description( $id ) {
     
    959984 * @since 2.9.0
    960985 *
     986 * @global array $wp_registered_sidebars
     987 *
    961988 * @param string $id sidebar ID.
    962  * @return string Sidebar description, if available. Null on failure to retrieve description.
     989 * @return string|void Sidebar description, if available.
    963990 */
    964991function wp_sidebar_description( $id ) {
     
    10081035 * @todo Document `$options` as a hash notation, re: WP_Widget::__construct() cross-reference.
    10091036 * @todo `$params` parameter?
     1037 *
     1038 * @global array $wp_registered_widget_controls
     1039 * @global array $wp_registered_widget_updates
     1040 * @global array $wp_registered_widgets
     1041 * @global array $_wp_deprecated_widgets_callbacks
    10101042 *
    10111043 * @param int|string   $id               Sidebar ID.
     
    10601092
    10611093/**
    1062  *
    10631094 * @global array $wp_registered_widget_updates
     1095 *
    10641096 * @param string   $id_base
    10651097 * @param callable $update_callback
     
    10871119 *
    10881120 * @global array $wp_registered_widget_controls
     1121 *
    10891122 * @param int|string $id
    10901123 * @param string     $name
    10911124 * @param callable   $form_callback
    10921125 * @param array      $options
    1093  * @return null
    10941126 */
    10951127function _register_widget_form_callback($id, $name, $form_callback, $options = array()) {
     
    11301162 */
    11311163function wp_unregister_widget_control($id) {
    1132     return wp_register_widget_control($id, '', '');
     1164    wp_register_widget_control( $id, '', '' );
    11331165}
    11341166
     
    11411173 *
    11421174 * @since 2.2.0
     1175 *
     1176 * @global array $wp_registered_sidebars
     1177 * @global array $wp_registered_widgets
    11431178 *
    11441179 * @param int|string $index Optional, default is 1. Index, name or ID of dynamic sidebar.
     
    13011336     * @param int|string $index   Index, name, or ID of the dynamic sidebar.
    13021337     */
    1303 
    1304     $did_one = apply_filters( 'dynamic_sidebar_has_widgets', $did_one, $index );
    1305 
    1306     return $did_one;
     1338    return apply_filters( 'dynamic_sidebar_has_widgets', $did_one, $index );
    13071339}
    13081340
     
    13221354 * @since 2.2.0
    13231355 *
    1324  * @param string $callback Optional, Widget callback to check.
    1325  * @param int $widget_id Optional, but needed for checking. Widget ID.
    1326  * @param string $id_base Optional, the base ID of a widget created by extending WP_Widget.
    1327  * @param bool $skip_inactive Optional, whether to check in 'wp_inactive_widgets'.
    1328  * @return mixed false if widget is not active or id of sidebar in which the widget is active.
     1356 * @global array $wp_registered_widgets
     1357 *
     1358 * @param string $callback      Optional, Widget callback to check.
     1359 * @param int    $widget_id     Optional, but needed for checking. Widget ID.
     1360 * @param string $id_base       Optional, the base ID of a widget created by extending WP_Widget.
     1361 * @param bool   $skip_inactive Optional, whether to check in 'wp_inactive_widgets'.
     1362 * @return string|false False if widget is not active or id of sidebar in which the widget is active.
    13291363 */
    13301364function is_active_widget($callback = false, $widget_id = false, $id_base = false, $skip_inactive = true) {
     
    13571391 * @since 2.2.0
    13581392 *
     1393 * @global array $wp_registered_widgets
     1394 * @global array $wp_registered_sidebars
     1395 *
    13591396 * @return bool True, if using widgets. False, if not using widgets.
    13601397 */
     
    14081445 * @access private
    14091446 *
     1447 * @global array $_wp_sidebars_widgets
     1448 * @global array $sidebars_widgets
     1449 *
    14101450 * @param bool $deprecated Not used (argument deprecated).
    14111451 * @return array Upgraded list of widgets to version 3 array format when called from the admin.
     
    14381478     * @param array $sidebars_widgets An associative array of sidebars and their widgets.
    14391479     */
    1440     $sidebars_widgets = apply_filters( 'sidebars_widgets', $sidebars_widgets );
    1441     return $sidebars_widgets;
     1480    return apply_filters( 'sidebars_widgets', $sidebars_widgets );
    14421481}
    14431482
     
    14621501 * @access private
    14631502 *
     1503 * @global array $wp_registered_sidebars
     1504 *
    14641505 * @return array
    14651506 */
     
    14791520 *
    14801521 * @since 2.8.0
     1522 *
     1523 * @global array $_wp_sidebars_widgets
    14811524 *
    14821525 * @param string $base_name
     
    15411584 * @since 2.8.0
    15421585 *
     1586 * @global WP_Widget_Factory $wp_widget_factory
     1587 *
    15431588 * @param string $widget   The widget's PHP class name (see default-widgets.php).
    15441589 * @param array  $instance Optional. The widget's instance settings. Default empty array.
     
    15871632/**
    15881633 * Private
     1634 *
     1635 * @return string
    15891636 */
    15901637function _get_widget_id_base($id) {
     
    15971644 * @access private
    15981645 * @since 3.3.0
     1646 *
     1647 * @global array $sidebars_widgets
    15991648 */
    16001649function _wp_sidebars_changed() {
     
    16121661 * @since 2.8.0
    16131662 *
     1663 * @global array $wp_registered_sidebars
     1664 * @global array $sidebars_widgets
     1665 * @global array $wp_registered_widgets
     1666 *
    16141667 * @param string|bool $theme_changed Whether the theme was changed as a boolean. A value
    16151668 *                                   of 'customize' defers updates for the Customizer.
    1616  * @return array
     1669 * @return array|void
    16171670 */
    16181671function retrieve_widgets( $theme_changed = false ) {
Note: See TracChangeset for help on using the changeset viewer.