Changeset 32639
- Timestamp:
- 05/28/2015 04:19:51 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widgets.php
r32602 r32639 251 251 } 252 252 253 /** 254 * @return callback 255 */ 253 256 public function _get_display_callback() { 254 257 return array($this, 'display_callback'); 255 258 } 256 259 /** 260 * @return callback 261 */ 257 262 public function _get_update_callback() { 258 263 return array($this, 'update_callback'); 259 264 } 260 265 /** 266 * @return callback 267 */ 261 268 public function _get_form_callback() { 262 269 return array($this, 'form_callback'); … … 273 280 * @since 3.9.0 274 281 * @access public 282 * 283 * @global WP_Customize_Manager $wp_customize 275 284 * 276 285 * @return bool True if within the Customizer preview, false if not. … … 345 354 * @since 2.8.0 346 355 * @access public 356 * 357 * @global array $wp_registered_widgets 347 358 * 348 359 * @param int $deprecated Not used. … … 586 597 * @since 2.8.0 587 598 * @access public 599 * 600 * @global array $wp_registered_widgets 588 601 */ 589 602 public function _register_widgets() { … … 633 646 */ 634 647 $wp_registered_widget_controls = array(); 648 /** 649 * @global array $wp_registered_widget_updates 650 */ 635 651 $wp_registered_widget_updates = array(); 636 652 637 653 /** 638 654 * Private 655 * 656 * @global array $_wp_sidebars_widgets 639 657 */ 640 658 $_wp_sidebars_widgets = array(); … … 642 660 /** 643 661 * Private 662 * 663 * @global array $_wp_deprecated_widgets_callbacks 644 664 */ 645 665 $GLOBALS['_wp_deprecated_widgets_callbacks'] = array( … … 678 698 * 679 699 * @see WP_Widget 680 * @see WP_Widget_Factory681 * @ uses WP_Widget_Factory700 * 701 * @global WP_Widget_Factory $wp_widget_factory 682 702 * 683 703 * @param string $widget_class The name of a class that extends WP_Widget … … 698 718 * 699 719 * @see WP_Widget 700 * @see WP_Widget_Factory701 * @ uses WP_Widget_Factory720 * 721 * @global WP_Widget_Factory $wp_widget_factory 702 722 * 703 723 * @param string $widget_class The name of a class that extends WP_Widget … … 719 739 * 720 740 * @see register_sidebar() The second parameter is documented by register_sidebar() and is the same here. 741 * 742 * @global array $wp_registered_sidebars 721 743 * 722 744 * @param int $number Optional. Number of sidebars to create. Default 1. … … 852 874 * @since 2.2.0 853 875 * 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. 855 877 * 856 878 * @param string $name The ID of the sidebar when it was added. … … 874 896 * @global array $wp_registered_widgets Uses stored registered widgets. 875 897 * @global array $wp_register_widget_defaults Retrieves widget defaults. 898 * @global array $wp_registered_widget_updates 899 * @global array $_wp_deprecated_widgets_callbacks 876 900 * 877 901 * @param int|string $id Widget ID. … … 886 910 * panel and/or theme. 887 911 * } 888 * @return null Will return if `$output_callback` is empty after removing widget.889 912 */ 890 913 function wp_register_sidebar_widget( $id, $name, $output_callback, $options = array() ) { … … 938 961 * @since 2.5.0 939 962 * 963 * @global array $wp_registered_widgets 964 * 940 965 * @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. 942 967 */ 943 968 function wp_widget_description( $id ) { … … 959 984 * @since 2.9.0 960 985 * 986 * @global array $wp_registered_sidebars 987 * 961 988 * @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. 963 990 */ 964 991 function wp_sidebar_description( $id ) { … … 1008 1035 * @todo Document `$options` as a hash notation, re: WP_Widget::__construct() cross-reference. 1009 1036 * @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 1010 1042 * 1011 1043 * @param int|string $id Sidebar ID. … … 1060 1092 1061 1093 /** 1062 *1063 1094 * @global array $wp_registered_widget_updates 1095 * 1064 1096 * @param string $id_base 1065 1097 * @param callable $update_callback … … 1087 1119 * 1088 1120 * @global array $wp_registered_widget_controls 1121 * 1089 1122 * @param int|string $id 1090 1123 * @param string $name 1091 1124 * @param callable $form_callback 1092 1125 * @param array $options 1093 * @return null1094 1126 */ 1095 1127 function _register_widget_form_callback($id, $name, $form_callback, $options = array()) { … … 1130 1162 */ 1131 1163 function wp_unregister_widget_control($id) { 1132 return wp_register_widget_control($id, '', '');1164 wp_register_widget_control( $id, '', '' ); 1133 1165 } 1134 1166 … … 1141 1173 * 1142 1174 * @since 2.2.0 1175 * 1176 * @global array $wp_registered_sidebars 1177 * @global array $wp_registered_widgets 1143 1178 * 1144 1179 * @param int|string $index Optional, default is 1. Index, name or ID of dynamic sidebar. … … 1301 1336 * @param int|string $index Index, name, or ID of the dynamic sidebar. 1302 1337 */ 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 ); 1307 1339 } 1308 1340 … … 1322 1354 * @since 2.2.0 1323 1355 * 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. 1329 1363 */ 1330 1364 function is_active_widget($callback = false, $widget_id = false, $id_base = false, $skip_inactive = true) { … … 1357 1391 * @since 2.2.0 1358 1392 * 1393 * @global array $wp_registered_widgets 1394 * @global array $wp_registered_sidebars 1395 * 1359 1396 * @return bool True, if using widgets. False, if not using widgets. 1360 1397 */ … … 1408 1445 * @access private 1409 1446 * 1447 * @global array $_wp_sidebars_widgets 1448 * @global array $sidebars_widgets 1449 * 1410 1450 * @param bool $deprecated Not used (argument deprecated). 1411 1451 * @return array Upgraded list of widgets to version 3 array format when called from the admin. … … 1438 1478 * @param array $sidebars_widgets An associative array of sidebars and their widgets. 1439 1479 */ 1440 $sidebars_widgets = apply_filters( 'sidebars_widgets', $sidebars_widgets ); 1441 return $sidebars_widgets; 1480 return apply_filters( 'sidebars_widgets', $sidebars_widgets ); 1442 1481 } 1443 1482 … … 1462 1501 * @access private 1463 1502 * 1503 * @global array $wp_registered_sidebars 1504 * 1464 1505 * @return array 1465 1506 */ … … 1479 1520 * 1480 1521 * @since 2.8.0 1522 * 1523 * @global array $_wp_sidebars_widgets 1481 1524 * 1482 1525 * @param string $base_name … … 1541 1584 * @since 2.8.0 1542 1585 * 1586 * @global WP_Widget_Factory $wp_widget_factory 1587 * 1543 1588 * @param string $widget The widget's PHP class name (see default-widgets.php). 1544 1589 * @param array $instance Optional. The widget's instance settings. Default empty array. … … 1587 1632 /** 1588 1633 * Private 1634 * 1635 * @return string 1589 1636 */ 1590 1637 function _get_widget_id_base($id) { … … 1597 1644 * @access private 1598 1645 * @since 3.3.0 1646 * 1647 * @global array $sidebars_widgets 1599 1648 */ 1600 1649 function _wp_sidebars_changed() { … … 1612 1661 * @since 2.8.0 1613 1662 * 1663 * @global array $wp_registered_sidebars 1664 * @global array $sidebars_widgets 1665 * @global array $wp_registered_widgets 1666 * 1614 1667 * @param string|bool $theme_changed Whether the theme was changed as a boolean. A value 1615 1668 * of 'customize' defers updates for the Customizer. 1616 * @return array 1669 * @return array|void 1617 1670 */ 1618 1671 function retrieve_widgets( $theme_changed = false ) {
Note: See TracChangeset
for help on using the changeset viewer.