Skip to:
Content

Ticket #7325: 7325-widget-registration-anonymous-functions.diff

File 7325-widget-registration-anonymous-functions.diff, 3.9 KB (added by tw2113, 13 months ago)
  • src/bp-blogs/bp-blogs-widgets.php

    diff --git src/bp-blogs/bp-blogs-widgets.php src/bp-blogs/bp-blogs-widgets.php
    index bc77206..a79aaca 100644
    function bp_blogs_register_widgets() { 
    2121        global $wpdb; 
    2222 
    2323        if ( bp_is_active( 'activity' ) && bp_is_root_blog( $wpdb->blogid ) ) { 
    24                 add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Blogs_Recent_Posts_Widget");' ) ); 
     24                add_action( 'widgets_init', function() { register_widget( 'BP_Blogs_Recent_Posts_Widget' ); } ); 
    2525        } 
    2626} 
    2727add_action( 'bp_register_widgets', 'bp_blogs_register_widgets' ); 
  • src/bp-core/bp-core-widgets.php

    diff --git src/bp-core/bp-core-widgets.php src/bp-core/bp-core-widgets.php
    index 14e5fb9..140c69f 100644
    if ( ! buddypress()->do_autoload ) { 
    2020 * @since 1.0.0 
    2121 */ 
    2222function bp_core_register_widgets() { 
    23         add_action('widgets_init', create_function('', 'return register_widget("BP_Core_Login_Widget");') ); 
     23        add_action( 'widgets_init', function() { register_widget( 'BP_Core_Login_Widget' ); } ); 
    2424} 
    2525add_action( 'bp_register_widgets', 'bp_core_register_widgets' ); 
  • src/bp-friends/bp-friends-widgets.php

    diff --git src/bp-friends/bp-friends-widgets.php src/bp-friends/bp-friends-widgets.php
    index a3e567e..4b9a0aa 100644
    function bp_friends_register_widgets() { 
    3131                return; 
    3232        } 
    3333 
    34         add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Core_Friends_Widget");' ) ); 
     34        add_action( 'widgets_init', function() { register_widget( 'BP_Core_Friends_Widget' ); } ); 
    3535} 
    3636add_action( 'bp_register_widgets', 'bp_friends_register_widgets' ); 
    3737 
  • src/bp-groups/bp-groups-widgets.php

    diff --git src/bp-groups/bp-groups-widgets.php src/bp-groups/bp-groups-widgets.php
    index 37911ac..9a2b193 100644
    if ( ! buddypress()->do_autoload ) { 
    2020 * @since 1.0.0 
    2121 */ 
    2222function groups_register_widgets() { 
    23         add_action('widgets_init', create_function('', 'return register_widget("BP_Groups_Widget");') ); 
     23        add_action( 'widgets_init', function() { register_widget( 'BP_Groups_Widget' ); } ); 
    2424} 
    2525add_action( 'bp_register_widgets', 'groups_register_widgets' ); 
    2626 
  • src/bp-members/bp-members-widgets.php

    diff --git src/bp-members/bp-members-widgets.php src/bp-members/bp-members-widgets.php
    index f83a24a..e72de3f 100644
    if ( ! buddypress()->do_autoload ) { 
    2424 * @since 2.2.0 
    2525 */ 
    2626function bp_members_register_widgets() { 
    27         add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Core_Members_Widget");'         ) ); 
    28         add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Core_Whos_Online_Widget");'     ) ); 
    29         add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Core_Recently_Active_Widget");' ) ); 
     27        add_action( 'widgets_init', function() { return register_widget( 'BP_Core_Members_Widget' );         } ); 
     28        add_action( 'widgets_init', function() { return register_widget( 'BP_Core_Whos_Online_Widget' );     } ); 
     29        add_action( 'widgets_init', function() { return register_widget( 'BP_Core_Recently_Active_Widget' ); } ); 
    3030} 
    3131add_action( 'bp_register_widgets', 'bp_members_register_widgets' ); 
    3232 
  • src/bp-messages/bp-messages-widgets.php

    diff --git src/bp-messages/bp-messages-widgets.php src/bp-messages/bp-messages-widgets.php
    index 3eb8908..8cf8d7b 100644
    if ( ! buddypress()->do_autoload ) { 
    2020 * @since 1.9.0 
    2121 */ 
    2222function bp_messages_register_widgets() { 
    23         add_action( 'widgets_init', create_function('', 'return register_widget( "BP_Messages_Sitewide_Notices_Widget" );') ); 
     23        add_action( 'widgets_init', function() { register_widget( 'BP_Messages_Sitewide_Notices_Widget' ); } ); 
    2424} 
    2525add_action( 'bp_register_widgets', 'bp_messages_register_widgets' );