Make WordPress Core

Ticket #7661: 7661.r8934.diff

File 7661.r8934.diff, 20.0 KB (added by jacobsantos, 17 years ago)

Skeleton patch based off of r8934

  • widgets.php

     
    11<?php
     2/**
     3 * API for creating dynamic sidebar without hardcoding functionality into
     4 * themes. Includes both internal WordPress routines and theme use routines.
     5 *
     6 * This functionality was found in a plugin before WordPress 2.2 release which
     7 * included it in the core from that point on.
     8 *
     9 * @link http://codex.wordpress.org/Plugins/WordPress_Widgets WordPress Widgets
     10 * @link http://codex.wordpress.org/Plugins/WordPress_Widgets_Api Widgets API
     11 *
     12 * @package WordPress
     13 * @subpackage Widgets
     14 */
    215
    316/* Global Variables */
    417
     18/** @ignore */
    519global $wp_registered_sidebars, $wp_registered_widgets, $wp_registered_widget_controls;
    620
     21/**
     22 * Stores the sidebars, since many themes can have more than one.
     23 *
     24 * @global array $wp_registered_sidebars
     25 * @since 2.2.0
     26 */
    727$wp_registered_sidebars = array();
     28
     29/**
     30 * Stores the registered widgets.
     31 *
     32 * @global array $wp_registered_widgets
     33 * @since 2.2.0
     34 */
    835$wp_registered_widgets = array();
     36
     37/**
     38 *
     39 * @global array $wp_registered_widget_controls
     40 * @since 2.2.0
     41 */
    942$wp_registered_widget_controls = array();
    1043
    1144/* Template tags & API functions */
    1245
     46/**
     47 * Creates multiple sidebars.
     48 *
     49 * If you wanted to quickly create multiple sidebars for a theme or internally.
     50 * This function will allow you to do so. If you don't pass the 'name' and/or
     51 * 'id' in $args, then they will be built for you.
     52 *
     53 * The default for the name is "Sidebar #", with '#' being replaced with the
     54 * number the sidebar is currently when greater than one. If first sidebar, the
     55 * name will be just "Sidebar". The default for id is "sidebar-" followed by the
     56 * number the sidebar creation is currently at.
     57 *
     58 * @since 2.2.0
     59 *
     60 * @see register_sidebar() The second parameter is documented by register_sidebar() and is the same here.
     61 * @uses parse_str() Converts a string to an array to be used in the rest of the function.
     62 * @uses register_sidebar() Sends single sidebar information [name, id] to this
     63 *      function to handle building the sidebar.
     64 *
     65 * @param int $number Number of sidebars to create.
     66 * @param string|array $args Builds Sidebar based off of 'name' and 'id' values.
     67 */
    1368function register_sidebars($number = 1, $args = array()) {
    1469        global $wp_registered_sidebars;
    1570        $number = (int) $number;
     
    4095        }
    4196}
    4297
     98/**
     99 * Builds the definition for a single sidebar and returns the ID.
     100 *
     101 * The $args parameter takes either a string or an array with 'name' and 'id'
     102 * contained in either usage. It will be noted that the values will be applied
     103 * to all sidebars, so if creating more than one, it will be advised to allow
     104 * for WordPress to create the defaults for you.
     105 *
     106 * Example for string would be <code>'name=whatever;id=whatever1'</code> and for
     107 * the array it would be <code>array(
     108 *    'name' => 'whatever',
     109 *    'id' => 'whatever1')</code>.
     110 *
     111 * name - The name of the sidebar, which presumably the title which will be
     112 *     displayed.
     113 * id - The unique identifier by which the sidebar will be called by.
     114 * before_widget - The content that will prepended to the widgets when they are
     115 *     displayed.
     116 * after_widget - The content that will be appended to the widgets when they are
     117 *     displayed.
     118 * before_title - The content that will be prepended to the title when displayed.
     119 * after_title - the content that will be appended to the title when displayed.
     120 *
     121 * <em>Content</em> is assumed to be HTML and should be formatted as such, but
     122 * doesn't have to be.
     123 *
     124 * @since 2.2.0
     125 * @uses $wp_registered_sidebars Stores the new sidebar in this array by sidebar ID.
     126 * @uses parse_str() Converts a string to an array to be used in the rest of the function.
     127 * @usedby register_sidebars()
     128 *
     129 * @param string|array $args Builds Sidebar based off of 'name' and 'id' values
     130 * @return string The sidebar id that was added.
     131 */
    43132function register_sidebar($args = array()) {
    44133        global $wp_registered_sidebars;
    45134
     
    64153        return $sidebar['id'];
    65154}
    66155
     156/**
     157 * Removes a sidebar from the list.
     158 *
     159 * @since 2.2.0
     160 *
     161 * @uses $wp_registered_sidebars Stores the new sidebar in this array by sidebar ID.
     162 *
     163 * @param string $name The ID of the sidebar when it was added.
     164 */
    67165function unregister_sidebar( $name ) {
    68166        global $wp_registered_sidebars;
    69167
     
    71169                unset( $wp_registered_sidebars[$name] );
    72170}
    73171
     172/**
     173 * {@internal Missing Short Description}}
     174 *
     175 * {@internal Missing Long Description}}
     176 *
     177 * @since 2.2.0
     178 * @uses wp_register_sidebar_widget() Passes the compiled arguments.
     179 *
     180 * @param string $name
     181 * @param callback $output_callback
     182 * @param string $classname
     183 */
    74184function register_sidebar_widget($name, $output_callback, $classname = '') {
    75185        // Compat
    76186        if ( is_array($name) ) {
     
    92202        call_user_func_array('wp_register_sidebar_widget', $args);
    93203}
    94204
     205/**
     206 * {@internal Missing Short Description}}
     207 *
     208 * {@internal Missing Long Description}}
     209 *
     210 * @since 2.2.0
     211 *
     212 * @uses $wp_registered_widgets {@internal Missing Description}}
     213 * @uses $wp_register_widget_defaults {@internal Missing Description}}
     214 *
     215 * @param int $id {@internal Missing Description}}
     216 * @param string $name {@internal Missing Description}}
     217 * @param callback $output_callback {@internal Missing Description}}
     218 * @param array|string $options {@internal Missing Description}}
     219 * @return null Will return if $output_callback is empty
     220 */
    95221function wp_register_sidebar_widget($id, $name, $output_callback, $options = array()) {
    96222        global $wp_registered_widgets;
    97223
     
    116242                $wp_registered_widgets[$id] = $widget;
    117243}
    118244
     245/**
     246 * {@internal Missing Short Description}}
     247 *
     248 * {@internal Missing Long Description}}
     249 *
     250 * @since 2.5.0
     251 *
     252 * @param unknown_type $id
     253 * @return unknown
     254 */
    119255function wp_widget_description( $id ) {
    120256        if ( !is_scalar($id) )
    121257                return;
     
    126262                return wp_specialchars( $wp_registered_widgets[$id]['description'] );
    127263}
    128264
     265/**
     266 * Alias of {@link wp_unregister_sidebar_widget()}.
     267 *
     268 * @see wp_unregister_sidebar_widget()
     269 *
     270 * @since 2.2.0
     271 *
     272 * @param int $id Same as wp_unregister_sidebar_widget()
     273 */
    129274function unregister_sidebar_widget($id) {
    130275        return wp_unregister_sidebar_widget($id);
    131276}
    132277
     278/**
     279 * {@internal Missing Short Description}}
     280 *
     281 * {@internal Missing Long Description}}
     282 *
     283 * @since 2.2.0
     284 *
     285 * @param int $id {@internal Missing Description}}
     286 */
    133287function wp_unregister_sidebar_widget($id) {
    134288        wp_register_sidebar_widget($id, '', '');
    135289        wp_unregister_widget_control($id);
    136290}
    137291
     292/**
     293 * {@internal Missing Short Description}}
     294 *
     295 * {@internal Missing Long Description}}
     296 *
     297 * @since 2.2.0
     298 *
     299 * @param unknown_type $name {@internal Missing Description}}
     300 * @param unknown_type $control_callback {@internal Missing Description}}
     301 * @param unknown_type $width {@internal Missing Description}}
     302 * @param unknown_type $height {@internal Missing Description}}
     303 */
    138304function register_widget_control($name, $control_callback, $width = '', $height = '') {
    139305        // Compat
    140306        if ( is_array($name) ) {
     
    164330 *   id_base: for multi-widgets (widgets which allow multiple instances such as the text widget), an id_base must be provided.
    165331 *            the widget id will ennd up looking like {$id_base}-{$unique_number}
    166332 */
     333/**
     334 * {@internal Missing Short Description}}
     335 *
     336 * {@internal Missing Long Description}}
     337 *
     338 * @since 2.2.0
     339 *
     340 * @param int $id {@internal Missing Description}}
     341 * @param string $name {@internal Missing Description}}
     342 * @param callback $control_callback {@internal Missing Description}}
     343 * @param array|string $options {@internal Missing Description}}
     344 */
    167345function wp_register_widget_control($id, $name, $control_callback, $options = array()) {
    168346        global $wp_registered_widget_controls;
    169347
     
    193371        $wp_registered_widget_controls[$id] = $widget;
    194372}
    195373
     374/**
     375 * Alias of {@link wp_unregister_widget_control()}.
     376 *
     377 * @since 2.2.0
     378 * @see wp_unregister_widget_control()
     379 *
     380 * @param int $id Widget ID
     381 */
    196382function unregister_widget_control($id) {
    197383        return wp_unregister_widget_control($id);
    198384}
    199385
     386/**
     387 * {@internal Missing Short Description}}
     388 *
     389 * {@internal Missing Long Description}}
     390 *
     391 * @since 2.2.0
     392 * @uses wp_register_widget_control() {@internal Missing Description}}
     393 *
     394 * @param int $id {@internal Missing Description}}
     395 */
    200396function wp_unregister_widget_control($id) {
    201397        return wp_register_widget_control($id, '', '');
    202398}
    203399
     400/**
     401 * {@internal Missing Short Description}}
     402 *
     403 * {@internal Missing Long Description}}
     404 *
     405 * @since 2.2.0
     406 *
     407 * @param unknown_type $index
     408 * @return unknown
     409 */
    204410function dynamic_sidebar($index = 1) {
    205411        global $wp_registered_sidebars, $wp_registered_widgets;
    206412
     
    254460        return $did_one;
    255461}
    256462
     463/**
     464 * {@internal Missing Short Description}}
     465 *
     466 * {@internal Missing Long Description}}
     467 *
     468 * @since 2.2.0
     469 *
     470 * @param unknown_type $callback
    257471/* @return mixed false if widget is not active or id of sidebar in which the widget is active
    258472 */
    259473function is_active_widget($callback, $widget_id = false) {
     
    271485        return false;
    272486}
    273487
     488/**
     489 * {@internal Missing Short Description}}
     490 *
     491 * {@internal Missing Long Description}}
     492 *
     493 * @since 2.2.0
     494 *
     495 * @return unknown
     496 */
    274497function is_dynamic_sidebar() {
    275498        global $wp_registered_widgets, $wp_registered_sidebars;
    276499        $sidebars_widgets = get_option('sidebars_widgets');
     
    286509
    287510/* Internal Functions */
    288511
     512/**
     513 * {@internal Missing Short Description}}
     514 *
     515 * {@internal Missing Long Description}}
     516 *
     517 * @since 2.2.0
     518 * @access private
     519 *
     520 * @param unknown_type $update
     521 * @return unknown
     522 */
    289523function wp_get_sidebars_widgets($update = true) {
    290524        global $wp_registered_widgets, $wp_registered_sidebars;
    291525
     
    364598        return $sidebars_widgets;
    365599}
    366600
     601/**
     602 * {@internal Missing Short Description}}
     603 *
     604 * {@internal Missing Long Description}}
     605 *
     606 * @since 2.2.0
     607 * @access private
     608 * @uses update_option()
     609 *
     610 * @param unknown_type $sidebars_widgets
     611 */
    367612function wp_set_sidebars_widgets( $sidebars_widgets ) {
    368613        update_option( 'sidebars_widgets', $sidebars_widgets );
    369614}
    370615
     616/**
     617 * {@internal Missing Short Description}}
     618 *
     619 * {@internal Missing Long Description}}
     620 *
     621 * @since 2.2.0
     622 * @access private
     623 *
     624 * @return unknown
     625 */
    371626function wp_get_widget_defaults() {
    372627        global $wp_registered_sidebars;
    373628
     
    381636
    382637/* Default Widgets */
    383638
     639/**
     640 * {@internal Missing Short Description}}
     641 *
     642 * {@internal Missing Long Description}}
     643 *
     644 * @since 2.2.0
     645 *
     646 * @param array $args Widget arguments.
     647 */
    384648function wp_widget_pages( $args ) {
    385649        extract( $args );
    386650        $options = get_option( 'widget_pages' );
     
    407671        }
    408672}
    409673
     674/**
     675 * {@internal Missing Short Description}}
     676 *
     677 * {@internal Missing Long Description}}
     678 *
     679 * @since 2.2.0
     680 */
    410681function wp_widget_pages_control() {
    411682        $options = $newoptions = get_option('widget_pages');
    412683        if ( $_POST['pages-submit'] ) {
     
    448719<?php
    449720}
    450721
     722/**
     723 * {@internal Missing Short Description}}
     724 *
     725 * {@internal Missing Long Description}}
     726 *
     727 * @since 2.2.0
     728 *
     729 * @param array $args Widget arguments.
     730 */
    451731function wp_widget_links($args) {
    452732        extract($args, EXTR_SKIP);
    453733
     
    459739        )));
    460740}
    461741
     742/**
     743 * {@internal Missing Short Description}}
     744 *
     745 * {@internal Missing Long Description}}
     746 *
     747 * @since 2.2.0
     748 *
     749 * @param array $args Widget arguments.
     750 */
    462751function wp_widget_search($args) {
    463752        extract($args);
    464753        $searchform_template = get_template_directory() . '/searchform.php';
     
    479768        echo $after_widget;
    480769}
    481770
     771/**
     772 * {@internal Missing Short Description}}
     773 *
     774 * {@internal Missing Long Description}}
     775 *
     776 * @since 2.2.0
     777 *
     778 * @param array $args Widget arguments.
     779 */
    482780function wp_widget_archives($args) {
    483781        extract($args);
    484782        $options = get_option('widget_archives');
     
    504802        echo $after_widget;
    505803}
    506804
     805/**
     806 * {@internal Missing Short Description}}
     807 *
     808 * {@internal Missing Long Description}}
     809 *
     810 * @since 2.2.0
     811 */
    507812function wp_widget_archives_control() {
    508813        $options = $newoptions = get_option('widget_archives');
    509814        if ( $_POST["archives-submit"] ) {
     
    529834<?php
    530835}
    531836
     837/**
     838 * {@internal Missing Short Description}}
     839 *
     840 * {@internal Missing Long Description}}
     841 *
     842 * @since 2.2.0
     843 *
     844 * @param array $args Widget Arguments
     845 */
    532846function wp_widget_meta($args) {
    533847        extract($args);
    534848        $options = get_option('widget_meta');
     
    547861                <?php echo $after_widget; ?>
    548862<?php
    549863}
     864
     865/**
     866 * {@internal Missing Short Description}}
     867 *
     868 * {@internal Missing Long Description}}
     869 *
     870 * @since 2.2.0
     871 */
    550872function wp_widget_meta_control() {
    551873        $options = $newoptions = get_option('widget_meta');
    552874        if ( $_POST["meta-submit"] ) {
     
    563885<?php
    564886}
    565887
     888/**
     889 * {@internal Missing Short Description}}
     890 *
     891 * {@internal Missing Long Description}}
     892 *
     893 * @since 2.2.0
     894 *
     895 * @param array $args Widget arguments.
     896 */
    566897function wp_widget_calendar($args) {
    567898        extract($args);
    568899        $options = get_option('widget_calendar');
     
    576907        echo $after_widget;
    577908}
    578909
     910/**
     911 * {@internal Missing Short Description}}
     912 *
     913 * {@internal Missing Long Description}}
     914 *
     915 * @since 2.2.0
     916 */
    579917function wp_widget_calendar_control() {
    580918        $options = $newoptions = get_option('widget_calendar');
    581919        if ( $_POST["calendar-submit"] ) {
     
    592930<?php
    593931}
    594932
    595 // See large comment section at end of this file
     933/**
     934 * Display the Text widget, depending on the widget number.
     935 *
     936 * Supports multiple text widgets and keeps track of the widget number by using
     937 * the $widget_args parameter. The option 'widget_text' is used to store the
     938 * content for the widgets. The content and title are passed through the
     939 * 'widget_text' and 'widget_title' filters respectively.
     940 *
     941 * @since 2.2.0
     942 *
     943 * @param array $args Widget arguments.
     944 * @param int $number Widget number.
     945 */
    596946function wp_widget_text($args, $widget_args = 1) {
    597947        extract( $args, EXTR_SKIP );
    598948        if ( is_numeric($widget_args) )
     
    614964<?php
    615965}
    616966
     967/**
     968 * {@internal Missing Short Description}}
     969 *
     970 * {@internal Missing Long Description}}
     971 *
     972 * @since 2.2.0
     973 *
     974 * @param int $widget_args Widget number.
     975 */
    617976function wp_widget_text_control($widget_args) {
    618977        global $wp_registered_widgets;
    619978        static $updated = false;
     
    6761035<?php
    6771036}
    6781037
     1038/**
     1039 * {@internal Missing Short Description}}
     1040 *
     1041 * {@internal Missing Long Description}}
     1042 *
     1043 * @since 2.2.0
     1044 */
    6791045function wp_widget_text_register() {
    6801046        if ( !$options = get_option('widget_text') )
    6811047                $options = array();
     
    7001066        }
    7011067}
    7021068
     1069/**
     1070 * {@internal Missing Short Description}}
     1071 *
     1072 * {@internal Missing Long Description}}
     1073 *
     1074 * @since 2.2.0
     1075 *
     1076 * @param unknown_type $args
     1077 * @param unknown_type $number
     1078 */
    7031079// See large comment section at end of this file
    7041080function wp_widget_categories($args, $widget_args = 1) {
    7051081        extract($args, EXTR_SKIP);
     
    7551131        echo $after_widget;
    7561132}
    7571133
     1134/**
     1135 * {@internal Missing Short Description}}
     1136 *
     1137 * {@internal Missing Long Description}}
     1138 *
     1139 * @since 2.2.0
     1140 *
     1141 * @param unknown_type $number
     1142 */
    7581143function wp_widget_categories_control( $widget_args ) {
    7591144        global $wp_registered_widgets;
    7601145        static $updated = false;
     
    8411226<?php
    8421227}
    8431228
     1229/**
     1230 * {@internal Missing Short Description}}
     1231 *
     1232 * {@internal Missing Long Description}}
     1233 *
     1234 * @since 2.3.0
     1235 */
    8441236function wp_widget_categories_register() {
    8451237        if ( !$options = get_option( 'widget_categories' ) )
    8461238                $options = array();
     
    8691261        }
    8701262}
    8711263
     1264/**
     1265 * {@internal Missing Short Description}}
     1266 *
     1267 * {@internal Missing Long Description}}
     1268 *
     1269 * @since 2.3.0
     1270 *
     1271 * @return unknown
     1272 */
    8721273function wp_widget_categories_upgrade() {
    8731274        $options = get_option( 'widget_categories' );
    8741275
     
    8961297        return $newoptions;
    8971298}
    8981299
     1300/**
     1301 * {@internal Missing Short Description}}
     1302 *
     1303 * {@internal Missing Long Description}}
     1304 *
     1305 * @since 2.2.0
     1306 *
     1307 * @param unknown_type $args
     1308 * @return unknown
     1309 */
    8991310function wp_widget_recent_entries($args) {
    9001311        if ( '%BEG_OF_TITLE%' != $args['before_title'] ) {
    9011312                if ( $output = wp_cache_get('widget_recent_entries', 'widget') )
     
    9351346/**
    9361347 * Remove recent entries widget items cache.
    9371348 *
    938  * @since unknown
     1349 * {@internal Missing Long Description}}
     1350 *
     1351 * @since 2.2.0
    9391352 */
    9401353function wp_flush_widget_recent_entries() {
    9411354        wp_cache_delete('widget_recent_entries', 'widget');
     
    9451358add_action('deleted_post', 'wp_flush_widget_recent_entries');
    9461359add_action('switch_theme', 'wp_flush_widget_recent_entries');
    9471360
     1361/**
     1362 * {@internal Missing Short Description}}
     1363 *
     1364 * {@internal Missing Long Description}}
     1365 *
     1366 * @since 2.2.0
     1367 */
    9481368function wp_widget_recent_entries_control() {
    9491369        $options = $newoptions = get_option('widget_recent_entries');
    9501370        if ( $_POST["recent-entries-submit"] ) {
     
    9711391<?php
    9721392}
    9731393
     1394/**
     1395 * {@internal Missing Short Description}}
     1396 *
     1397 * {@internal Missing Long Description}}
     1398 *
     1399 * @since 2.2.0
     1400 *
     1401 * @param unknown_type $args
     1402 */
    9741403function wp_widget_recent_comments($args) {
    9751404        global $wpdb, $comments, $comment;
    9761405        extract($args, EXTR_SKIP);
     
    10021431/**
    10031432 * Remove the cache for recent comments widget.
    10041433 *
    1005  * @since unknown
     1434 * {@internal Missing Long Description}}
     1435 *
     1436 * @since 2.2.0
    10061437 */
    10071438function wp_delete_recent_comments_cache() {
    10081439        wp_cache_delete( 'recent_comments', 'widget' );
     
    10101441add_action( 'comment_post', 'wp_delete_recent_comments_cache' );
    10111442add_action( 'wp_set_comment_status', 'wp_delete_recent_comments_cache' );
    10121443
     1444/**
     1445 * {@internal Missing Short Description}}
     1446 *
     1447 * {@internal Missing Long Description}}
     1448 *
     1449 * @since 2.2.0
     1450 */
    10131451function wp_widget_recent_comments_control() {
    10141452        $options = $newoptions = get_option('widget_recent_comments');
    10151453        if ( $_POST["recent-comments-submit"] ) {
     
    10381476/**
    10391477 * Display the style for recent comments widget.
    10401478 *
    1041  * @since unknown
     1479 * {@internal Missing Long Description}}
     1480 *
     1481 * @since 2.2.0
    10421482 */
    10431483function wp_widget_recent_comments_style() {
    10441484?>
     
    10461486<?php
    10471487}
    10481488
     1489/**
     1490 * {@internal Missing Short Description}}
     1491 *
     1492 * {@internal Missing Long Description}}
     1493 *
     1494 * @since 2.2.0
     1495 */
    10491496function wp_widget_recent_comments_register() {
    10501497        $widget_ops = array('classname' => 'widget_recent_comments', 'description' => __( 'The most recent comments' ) );
    10511498        wp_register_sidebar_widget('recent-comments', __('Recent Comments'), 'wp_widget_recent_comments', $widget_ops);
     
    10551502                add_action('wp_head', 'wp_widget_recent_comments_style');
    10561503}
    10571504
     1505/**
     1506 * {@internal Missing Short Description}}
     1507 *
     1508 * {@internal Missing Long Description}}
     1509 *
     1510 * @since 2.2.0
     1511 *
     1512 * @param unknown_type $args
     1513 * @param unknown_type $number
     1514 */
    10581515// See large comment section at end of this file
    10591516function wp_widget_rss($args, $widget_args = 1) {
    10601517        extract($args, EXTR_SKIP);
     
    11901647        }
    11911648}
    11921649
     1650/**
     1651 * wp_widget_rss_control() - {@internal Missing Short Description}}
     1652 *
     1653 * {@internal Missing Long Description}}
     1654 *
     1655 * @since 2.2.0
     1656 *
     1657 * @param unknown_type $widget_args
     1658 */
    11931659function wp_widget_rss_control($widget_args) {
    11941660        global $wp_registered_widgets;
    11951661        static $updated = false;
     
    13841850/**
    13851851 * Register RSS widget to allow multiple RSS widgets.
    13861852 *
    1387  * @since unknown
     1853 * @since 2.2.0
    13881854 */
    13891855function wp_widget_rss_register() {
    13901856        if ( !$options = get_option('widget_rss') )
     
    14111877}
    14121878
    14131879/**
    1414  * Display tag cloud WordPress widget.
     1880 * Display tag cloud widget.
    14151881 *
    1416  * @since unknown
     1882 * @since 2.3.0
    14171883 *
    14181884 * @param array $args Widget arguments.
    14191885 */
     
    14331899 *
    14341900 * Displays management form for changing the tag cloud widget title.
    14351901 *
    1436  * @since unknown
     1902 * @since 2.3.0
    14371903 */
    14381904function wp_widget_tag_cloud_control() {
    14391905        $options = $newoptions = get_option('widget_tag_cloud');
     
    14621928 * Calls 'widgets_init' action after all of the WordPress widgets have been
    14631929 * registered.
    14641930 *
    1465  * @since unknown
     1931 * @since 2.2.0
    14661932 */
    14671933function wp_widgets_init() {
    14681934        if ( !is_blog_installed() )