Make WordPress Core


Ignore:
Timestamp:
05/11/2017 09:10:54 PM (8 years ago)
Author:
westonruter
Message:

Widgets: Introduce media widgets for images, audio, and video with extensible base for additional media widgets in the future.

The last time a new widget was introduced, Vuvuzelas were a thing, Angry Birds started taking over phones, and WordPress stopped shipping with Kubrick. Seven years and 17 releases without new widgets have been enough, time to spice up your sidebar!

Props westonruter, melchoyce, obenland, timmydcrawford, adamsilverstein, gonom9, wonderboymusic, Fab1en, DrewAPicture, sirbrillig, joen, matias, samikeijonen, afercia, celloexpressions, designsimply, michelleweber, ranh, kjellr, karmatosed.
Fixes #32417, #39993, #39994, #39995.

File:
1 edited

Legend:

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

    r40251 r40640  
    14371437 */
    14381438function wp_widgets_init() {
    1439     if ( !is_blog_installed() )
    1440         return;
    1441 
    1442     register_widget('WP_Widget_Pages');
    1443 
    1444     register_widget('WP_Widget_Calendar');
    1445 
    1446     register_widget('WP_Widget_Archives');
    1447 
    1448     if ( get_option( 'link_manager_enabled' ) )
    1449         register_widget('WP_Widget_Links');
    1450 
    1451     register_widget('WP_Widget_Meta');
    1452 
    1453     register_widget('WP_Widget_Search');
    1454 
    1455     register_widget('WP_Widget_Text');
    1456 
    1457     register_widget('WP_Widget_Categories');
    1458 
    1459     register_widget('WP_Widget_Recent_Posts');
    1460 
    1461     register_widget('WP_Widget_Recent_Comments');
    1462 
    1463     register_widget('WP_Widget_RSS');
    1464 
    1465     register_widget('WP_Widget_Tag_Cloud');
    1466 
    1467     register_widget('WP_Nav_Menu_Widget');
     1439    if ( ! is_blog_installed() ) {
     1440        return;
     1441    }
     1442
     1443    register_widget( 'WP_Widget_Pages' );
     1444
     1445    register_widget( 'WP_Widget_Calendar' );
     1446
     1447    register_widget( 'WP_Widget_Archives' );
     1448
     1449    if ( get_option( 'link_manager_enabled' ) ) {
     1450        register_widget( 'WP_Widget_Links' );
     1451    }
     1452
     1453    register_widget( 'WP_Widget_Media_Audio' );
     1454
     1455    register_widget( 'WP_Widget_Media_Image' );
     1456
     1457    register_widget( 'WP_Widget_Media_Video' );
     1458
     1459    register_widget( 'WP_Widget_Meta' );
     1460
     1461    register_widget( 'WP_Widget_Search' );
     1462
     1463    register_widget( 'WP_Widget_Text' );
     1464
     1465    register_widget( 'WP_Widget_Categories' );
     1466
     1467    register_widget( 'WP_Widget_Recent_Posts' );
     1468
     1469    register_widget( 'WP_Widget_Recent_Comments' );
     1470
     1471    register_widget( 'WP_Widget_RSS' );
     1472
     1473    register_widget( 'WP_Widget_Tag_Cloud' );
     1474
     1475    register_widget( 'WP_Nav_Menu_Widget' );
    14681476
    14691477    /**
Note: See TracChangeset for help on using the changeset viewer.