WordPress.org

Forums

BuddyPress Registration Options
Silly errors (1 post)

  1. dreamingbear
    Member
    Posted 2 years ago #

    for version 4.0
    It's really strange, the code is there and works but for some silly errors that make the plugin completely unusable. How it is that the author had the skill to create a perfectly usable plugin and then releases it with obvious errors?

    Apply this patch:

    --- includes/core.php Mon Oct 22 22:31:36 2012
    +++ includes/core.php Tue Feb 05 23:19:49 2013
    @@ -15,7 +15,7 @@
    add_action( 'init', 'wds_bp_registration_options_core_init' );
    function wds_bp_registration_options_core_init(){
    global $bp_moderate, $bprwg_privacy_network, $wpdb, $bp, $user_ID, $blog_id;
    - if ( !is_admin() ) {
    + if ( !current_user_can( 'edit_users' ) ) {
    if ( is_multisite() ) {
    $blogid = $blog_id;
    switch_to_blog(1);
    @@ -31,14 +31,16 @@
    if ( $bp->current_component && $user_ID == 0 && $bp->current_component != 'register' && $bp->current_component != 'activate' ) {
    if ( $bp->pages->register->slug ) {
    wp_redirect( site_url().'/'.$bp->pages->register->slug );
    + exit;
    } else {
    exit();
    }
    //if logged in and not approved then redirect to their profile page
    } elseif ( $bp->current_component && $user_ID > 0 && ( $bp->displayed_user->userdata == '' || $bp->displayed_user->userdata != '' && $bp->displayed_user->id != $user_ID ) ) {
    $user = get_userdata($user_ID);
    - if ( $user->user_status == 69 ) {
    + if ( $user->data->user_status == 69 ) {
    wp_redirect( $bp->loggedin_user->domain );
    + exit;
    }
    }
    }
    @@ -197,7 +199,7 @@
    *
    */
    add_filter('bp_after_activate_content', 'wds_bp_registration_options_bp_after_activate_content');
    -add_filter('bp_before_member_header', 'wds_bp_registration_options_bp_before_member_header');
    +add_filter('bp_before_member_header', 'wds_bp_registration_options_bp_after_activate_content');
    function wds_bp_registration_options_bp_after_activate_content(){
    global $bp_moderate, $user_ID, $blog_id;
    if ( is_multisite() ) {
    @@ -205,7 +207,7 @@
    switch_to_blog(1);
    }
    if ( $bp_moderate && isset( $_GET['key'] ) || $bp_moderate && $user_ID > 0 ) {
    - $activate_message = get_option('bprwg_activate_message');
    + $activate_message = stripslashes(get_option('bprwg_activate_message'));
    echo '<div id="message" class="error"><p>'.$activate_message.'</p></div>';
    }
    if ( is_multisite() ) {
    @@ -220,7 +222,7 @@
    *
    *
    */
    -add_action( 'bp_core_activate_account', 'wds_bp_registration_options_bp_core_activate_account');
    +
    function wds_bp_registration_options_bp_core_activate_account($user_id){
    global $wpdb, $bp_moderate;
    if ( $bp_moderate ) {
    @@ -243,5 +245,5 @@
    }
    }
    }
    -
    +add_action( 'bp_core_activate_account', 'wds_bp_registration_options_bp_core_activate_account');
    ?>
    \ No newline at end of file

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • BuddyPress Registration Options
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.