Home Forums Community Support Forum WordPress Plugins Other Plugins Never Delete Admin

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1979
    schwarzaufweiss
    Participant

    I’m using “Never Delete Admin” together with BuddyPress (WP 3.8.3 single and BP 1.9.2). Is it possible for you to correct the counter for the number of Members / Users. ID 1 is now hidden but the counter in the front-end tab of BP still includes that user what is confusing.
    Thanks for help, Hans

    • This topic was modified 8 years, 9 months ago by .
    #1981
    Slavi Marinov
    Keymaster

    Hi Hans,

    oh, ok. So you’d like the user number to decrease. Make sense and will make the plugin even more stealthier.

    Slavi

    #1997
    schwarzaufweiss
    Participant

    Hi Slava,

    Any chance to get an update with that “counter fix”?

    Hans

    #1998
    Slavi Marinov
    Keymaster

    Hi Hans,

    Yes, just pushed a new version.
    You should be prompted to update soon.

    Slavi

    #1999
    Slavi Marinov
    Keymaster

    oh, forgot to that you’ll have to go in the settings and click on the Save button again (without doing any changes).

    #2001
    schwarzaufweiss
    Participant

    Hello Slavi,

    I have just installed 1.0.1 what is working nicely for WP itself re user count in the backend but not for BuddyPress. In the BP frontend I still have that hidden admin user included in the user (member) count. Can you fix that? Would be absolutely great!

    #2002
    schwarzaufweiss
    Participant

    btw: I’m using the «stable» version of BuddyPress 1.9.2 and not the just released 2.0 – your plugin is really the last missing part in my project called XTRABOX: http://www.xtrabox.ch

    #2003
    Slavi Marinov
    Keymaster

    Hans,

    It seems you’re using the plugin in an even more interesting way. Cool.
    Can you post the direct link to the members page where that admin shows up?

    Slavi

    #2004
    schwarzaufweiss
    Participant

    Slavi,

    You will see that the admin account with ID 1 is hidden, it’s only the counter in the BP Members tab what still includes that «Superadmin».

    #2028
    schwarzaufweiss
    Participant

    Hi Slavi,

    Put the following code in bp-custom.php to make your plugin BuddyPress 2.x compatible:

    
    add_filter( 'bp_core_get_active_member_count', 'devb_exclude_in_members_count' );
    function devb_exclude_in_members_count( $count ){
        
        return $count -1;
            
    }
    
    add_filter( 'bp_before_has_members_parse_args', 'devb_filter_members_args', 10, 3 );
    
    function devb_filter_members_args( $r ){
        //for friends etc
        if( isset($r['user_id']))
            return $r;
        
        //otherwise
        $options = get_option('orbisius_never_delete_admin_options');
        
        $user_login = $options['system_account'];
        
        $user = get_user_by( 'login', $user_login );
        
        if( $user ){
           $r['exclude'] = array_merge( (array) ($user->ID), (array)$r['exclude']);    
        //print_r($r);
            
        }
        
        return $r;
        
    }
    
    #2032
    schwarzaufweiss
    Participant

    Hi Slavi,

    I can see…
    “<!– Powered by Orbisius Never Delete Admin | URL: http://orbisius.com/products/wordpress-plugins/orbisius-never-delete-admin/?utm_source=orbisius-never-delete-admin&utm_medium=plugin-header&utm_campaign=product –>”
    …in the source of my pages. I don’t like something like that in a premium plugin.

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.