Skip to:
Content

BuddyPress.org

Changeset 3661


Ignore:
Timestamp:
01/05/2011 10:27:07 PM (14 years ago)
Author:
djpaul
Message:

Don't include wp-includes/registration.php if on WordPress 3.1. Fixes #2997

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r3641 r3661  
    547547
    548548    if ( $usernames = bp_activity_find_mentions( strip_tags( $activity->content ) ) ) {
    549         include_once( ABSPATH . WPINC . '/registration.php' );
     549        bp_core_maybe_include_user_registration_file();
    550550
    551551        foreach( (array)$usernames as $username ) {
  • trunk/bp-activity/bp-activity-filters.php

    r3592 r3661  
    114114 */
    115115function bp_activity_at_name_filter( $content ) {
    116     include_once( ABSPATH . WPINC . '/registration.php' );
     116    bp_core_maybe_include_user_registration_file();
    117117
    118118    $usernames = bp_activity_find_mentions( $content );
  • trunk/bp-blogs/bp-blogs-templatetags.php

    r3635 r3661  
    326326    global $bp;
    327327
    328     require_once( ABSPATH . WPINC . '/registration.php' );
     328    bp_core_maybe_include_user_registration_file();
    329329
    330330    if ( isset($_POST['submit']) ) {
  • trunk/bp-core.php

    r3643 r3661  
    283283
    284284    return apply_filters( 'bp_core_get_page_names', $pages );
     285}
     286
     287/**
     288 * If we're not on WordPress 3.1+, then include the file containing the user registration methods.
     289 *
     290 * @global float $wp_version WordPress version number
     291 * @since 1.3
     292 */
     293function bp_core_maybe_include_user_registration_file() {
     294    global $wp_version;
     295
     296    if ( $wp_version >= 3.1 )
     297        return;
     298
     299    require_once( ABSPATH . WPINC . '/registration.php' );
    285300}
    286301
  • trunk/bp-core/bp-core-settings.php

    r3620 r3661  
    5252        check_admin_referer('bp_settings_general');
    5353
    54         require_once( ABSPATH . WPINC . '/registration.php' );
     54        bp_core_maybe_include_user_registration_file();
    5555
    5656        // Form has been submitted and nonce checks out, lets do it.
  • trunk/bp-core/bp-core-signup.php

    r3637 r3661  
    3636        check_admin_referer( 'bp_new_signup' );
    3737
    38         require_once( ABSPATH . WPINC . '/registration.php' );
     38        bp_core_maybe_include_user_registration_file();
    3939
    4040        /* Check the base account details for problems */
     
    218218    if ( isset( $_GET['key'] ) ) {
    219219
    220         require_once( ABSPATH . WPINC . '/registration.php' );
     220        bp_core_maybe_include_user_registration_file();
    221221
    222222        /* Activate the signup */
Note: See TracChangeset for help on using the changeset viewer.