Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'Hide Admin'

Viewing 25 results - 226 through 250 (of 915 total)
  • Author
    Search Results
  • #255243
    sharmavishal
    Participant

    1. In BuddyPress, we by default get to see member page. I want to know how to redirect someone who is logging in/ new user after registration to News feed?

    search for login redirect plugins for buddypress

    2. I want to keep those wall, timeline and all in menu bar instead of profile tab. How to do that?

    check wp admin bar codex or associated plugins

    3. I am unable to hide admin bar/ that WordPress logo bar for non-admin user. no plugin helping me out.

    am aware of atleast 2 plugins which are working for me. u need to test/check which ones work with ur theme/setup

    4. how to make the menu such that signed in user can see log out button and other sign in/ register?

    via buddypress components in the menus. logged in and logged out menu links

    5. how to enable realtime notification and instant messaging private n groups both?

    notification is already there and its real time. i belive there is a group chat plugin for buddypress as well

    6. how to remove show dropdown menu in profile

    that would depend on ur theme which u are using

    PS:- I don’t know PHP much. moreover, I cannot afford to hire someone.

    then this would take much time and effort to customise it as per ur needs

    start from here

    Configure BuddyPress

    #255238
    kunaldas1997
    Participant

    hello there!

    I am new to BuddyPress.
    1. In BuddyPress, we by default get to see member page. I want to know how to redirect someone who is logging in/ new user after registration to News feed?
    2. I want to keep those wall, timeline and all in menu bar instead of profile tab. How to do that?
    3. I am unable to hide admin bar/ that WordPress logo bar for non-admin user. no plugin helping me out.
    4. how to make the menu such that signed in user can see log out button and other sign in/ register?
    5. how to enable realtime notification and instant messaging private n groups both?
    6. how to remove show dropdown menu in profile
    PS:- I don’t know PHP much. moreover, I cannot afford to hire someone.

    gerwinb
    Participant

    For our site we use buddypress. In the groups we removed the subnav ‘admin/group-settings’, but in 2.6 this item is visible again. How can I remove it in this new version?

    I used:

    function gwb_remove_group_admin_tab() {
    	if ( ! bp_is_group() || ! ( bp_is_current_action( 'admin' ) && bp_action_variable( 0 ) ) || is_super_admin() ) {
    		return;
    	}
    
    	// Add the admin subnav slug you want to hide in the
    	// following array
    	$hide_tabs = array(
    		'group-settings' => 1,
    		'delete-group' => 1,
    	);
    
    	$parent_nav_slug = bp_get_current_group_slug() . '_manage';
    
    	// Remove the nav items
    	foreach ( array_keys( $hide_tabs ) as $tab ) {
    		bp_core_remove_subnav_item( $parent_nav_slug, $tab );
    	}
    
    add_action( 'bp_actions', 'gwb_remove_group_admin_tab', 9 );

    With the last update this code doesn’t work anymore so I tried:

    
    function gwb_remove_group_admin_tab() {
       bp_core_remove_subnav_item( 'admin', 'group-settings', 'groups' );
    }
    add_action('bp_actions', 'gwb_remove_group_admin_tab',9);

    What did I do wrong?

    Thanks!

    Masoud
    Participant

    @shanebp
    hi. tnx for answer and patience. got 5 more minutes? 🙂
    i read and worked on what you said. and if i want to be honest, i could’t do anything special unfortunately.
    now, i want to ask your opinion about this idea:
    i’ve come up with the idea of hiding that field. (not email field), how?
    with the use of if condition… (if it’s not empty show it. if it has data, hide it)!
    ——-
    i’ve created a custom-meta with this code in theme functions:

    add_action( 'personal_options_update', 'my_save_extra_profile_fields' );
    add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' );
    function my_save_extra_profile_fields( $user_id ) {
    if ( !current_user_can( 'edit_user', $user_id ) )
    	return false;
    /* Copy and paste this line for additional fields. */
    add_user_meta( $user_id, ‘person_relation’, 30318 );
    update_usermeta( absint( $user_id ), 'person_relation', wp_kses_post( $_POST['person_relation'] ) );
    update_user_meta( $user_id, 'person_relation', $_POST['person_relation'] );
    }

    and used it in my buddypress signup form, to get data from users. ok?
    after what you said, i went to edit.php (copy to my theme buddypress folder…)
    and added these codes. but it seems that they do not recieve/send data at all.
    it looks like they are empty!! 😐
    after <?php at the start,
    i added :

    global $user, $user_id;
    $person_relation = get_the_author_meta( 'person_relation', $user->ID );
    $user_id = get_current_user_id();

    and in the <form> ,
    i added this piece of code (not working)
    then copied and changed the “save changes button”.
    so there is 2 buttons. one is for my-custom-meta, and the other is for buddypress form.
    buddypress edit page
    if user writes the name and click save. the box/button, all should gone. and i have to see the data in Users admin panel.
    but nothing is getting save… and i dont know where am i doing it wrong

    <?php if( $person_relation == '' ): ?>
    <tr>
    <th><label for="person_relation">Invitor's Name</label></th>
    <td>
    <input type="text" name="person_relation" id="person_relation" value="<?php update_usermeta( $user_id, 'person_relation', $_POST['person_relation'] ); ?>" class="regular-text" /><br />
    <span class="description">Please enter your invitor's name.</span>
    </td>
    </tr>
    <input type="hidden" id="userID" value="<?php echo $user_id ?>"/>
    <div class="submit">
    <input type="submit" name="profile-group-edit-submit" id="profile-group-edit-submit" value="<?php esc_attr_e( 'Save Name', 'buddypress' ); ?> " />
    </div>
    <input type="hidden" name="person_relation" id="person_relation" value="<?php update_usermeta( $user_id, 'person_relation', $_POST['person_relation'] ); ?>" />
    <?php add_action( 'personal_options_update', 'my_save_extra_profile_fields' ); ?>
    <?php add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' ); ?>
    <?php do_action( 'xprofile_profile_field_data_updated'); ?>
    <?php endif; ?>

    so sorry for long description. tnx for help.
    any suggestions do you have?

    danbp
    Participant

    @masoud1111,

    thank you for your appreciation. And sorry for my confusion about setting > general. That’s traditionnally the path used on admin dashboard. In regard of the picture, it’s the mandatory wp registration email field. This part is on your-site/members/USERNAME/settings.

    The template file you can modify is members/single/settings/general.php
    In that file is a form who contains a label and a input type for “email”. To hide, you could add a conditionnal for admin’s only.

    For example, before both label and input lines, add

    <?php if(is_super_admin() ): ?>
       <label>bla
       <input>bla
    <?php endif; ?>

    To be complete, you may want to show message to explain about the email field. In that case, add something like following above:

    
    <?php if ( !is_super_admin() ) : ?>
    <p>Ask site admin if you want to change your email address.</p>
    <?php endif; ?>
    Masoud
    Participant

    @danbp
    first of all i have to thank you for your quick answer and great support.
    i am very satisfied with the support of this plugin. you guys are great.
    thank you very much.
    —-
    1 & 2 ) the function worked great, but the “private message” button in profile still remains!
    i mean if a user can not send message so there is no need to show them that button.
    is it possible to show that button only to admins too?

    3)
    oh no no. i didnt mean WP DASHBOARD.
    i dont want users to be able to change their email account on their own, after sign-up(bp sing up form), unless they contact admin of site, and request the change of email.
    the option of changing email account is in
    Setting Tab > General Tab
    there is a place for them to write their new email and …
    i want to hide and disable it for normal users and available only for admin.
    look at this picture please.
    the red area.

    danbp
    Participant

    @5high Yep! You’re right. The form is now build separately. To hide it conditionnaly, it’s much easier as previously.

    What you have to do from now on, is to add a condition on the template part call.

    The form template file is post-form.php (activity/post-form.php)

    On each activity template (swa, members, groups,…), there a call to this file. bp_get_template_part( 'activity/post-form' );

    To solve your problem, you have just to add the condition you want for this call.

    In your case, as you want to disallow the form only on swa and on member’s activity, you modify
    child-theme/buddypress/activity/index.php (site wide activity) and child-theme/buddypress/members/single/activity.php (profile activity)

    For example i hide the form to any user except site admin by using:

    if ( is_user_logged_in() && is_super_admin() )
    	bp_get_template_part( 'activity/post-form' );

    Hope to be clear ! 😉

    danbp
    Participant

    Give this a try: (add to bp-custom.php) 1) & 2):

    function bpfr_hide_tabs() {
    global $bp;
    
    	if ( bp_is_user() && !is_super_admin() ) {
    		bp_core_remove_nav_item( 'notifications' );
    		bp_core_remove_subnav_item( 'messages', 'compose' );
    	}
    	
    }
    add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );

    3) With BP and xprofile component activated, a user doesn’t need access to WP dashboard. He can change his profile credentials from front-end.
    Easiest way would be to use this plugin.

    Retrieving them the possibility to change their email is anyway not a good idea. What happen when a user changed from yahoo to gmail, but can’t login because he lost his password ? Where will the new pwd be sent ?

    Perhaps you have also to remove this from the BP usermenu on toolbar ?
    Here’s how you can do it:

    function admin_bar_remove_this(){
    global $wp_admin_bar;
    	$wp_admin_bar->remove_node('my-account-messages-compose');
    }
    add_action('wp_before_admin_bar_render','admin_bar_remove_this');
    Masoud
    Participant

    hi.
    i want to hide some tabs only for non-admins.
    for example “Compose
    underMessage > Compose.
    in bp-messages/classes/class-bp-component.php lines:199 & 287.
    it’s possible to add a conditional if().

    <strong>if(current_user_can(administrator))</strong>
    {
    $sub_nav[] = array(
    'name'=> __( 'Compose', 'buddypress' ),
    'slug'=> 'compose',
    'parent_url'=> $messages_link,
    'parent_slug'=> $slug,
    'screen_function'=> 'messages_screen_compose',
    'position'=> 30,
    'user_has_access'=> $access
    }

    and do this for line 287.
    so, both the Compose tab and the ability to composing a msg will be in admin hands.
    BUT it’s not a good way to hack core codes!
    so how can i do this?

    the things i want to hide from non-admins:
    1) Notification tab
    2) Compose (sub-nav)
    3) hide the panel and restrict the access to change Account email (from Setting > General)

    thanks in advance.

    #253893
    danleachuk
    Participant

    I am attempting to hide the “Delete Group” sub nav item in Groups >> Manage, using the following code in bp-custom.php

    if(!current_user_can(‘administrator’)){
    bp_core_remove_subnav_item( bp_get_current_group_slug() . ‘_manage’, ‘delete-group’ );

    }}

    This does delete the item. However it has an unusual side-effect I don’t understand:

    groups/test/admin/ brings up a 404 error (without the code above, this brings up the Manage >> Details tab)
    groups/test/admin/edit-details still works after I type it in manually.

    How can I fix this?

    I have a fresh WP and BP install. Twenty-Sixteen theme.

    justarandomuser
    Participant

    I just found a little problem on my website.
    As an admin I can edit directly on the Front-End the profiles of my users if there is bad data.

    I show the fields like this (I have only 1 group):

    <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
    // many things are going on here! but nothing special
    <?php enwhile; ?>

    The problem is… EMPTY fields are not in the output!

    I tried to put array('hide_empty_fields' => 0) into bp_the_profile_field() but this doesn’t work.

    I handle everything (display of the profile, editing of the profile fields etc) in <my-theme>/buddypress/members/single/cover-image-header.php

    Please help me 🙁

    #253283
    semperaye
    Participant

    There is this code posted by someone on this thread 2.5 years ago:

    https://buddypress.org/support/topic/hide-certain-admins-as-being-online/

    /* disable Recording Site Activity for Admins */
    add_action(“bp_loaded”,”bpdev_init_sm_mode”);
    function bpdev_init_sm_mode(){
    if(is_super_admin())
    remove_action(“wp_head”,”bp_core_record_activity”);//id SM is on, remove the record activity hook
    }
    /* ——————————————– */

    But not sure if that is custom css, or if that is something that needs to be placed in the bp-custom.php file? Also, that code appears to only block admin activity, not profile, and members list….

    Is there a way to do all of this via some custom CSS? That would obviously be the easiest way to solve this since there are no currently working plugins.

    semperaye
    Participant

    I found this post from 2 years ago….is the only way to block admins from the members list, profile, and activity to edit the bp-custom.php file, or is there a new plugin or method?

    https://buddypress.org/support/topic/hide-admin-from-members-and-activity/

    I do not know how to edit these files, I would probably break something…I look forward to a response/advice on how to move forward ty!

    #252534
    mln83
    Participant

    Hi guys,

    I am running some tests on my site and found a few deprecated functions and recommendations for the BuddyPress plugin:

    Unsafe/buddypress/bp-groups/bp-groups-actions.php view source
    base64_decode at line 141:
    $bp->groups->completed_create_steps = json_decode( base64_decode( stripslashes( $_COOKIE['bp_completed_create_steps'] ) ) ); 
    Potential risk: High. Decode data encoded with MIME base64. May be used to obfuscate (hide) malicious code. Often paired with eval function to execute malicious code.
    DeprecatedUnsafe/buddypress/bp-forums/bbpress/bb-includes/functions.bb-core.php view source
    force_ssl_login at line 566:
    ( ( $context & BB_URI_CONTEXT_BB_USER_FORMS ) && force_ssl_login() ) // Force https when required on user forms 
    Deprecated 4.4.0 Use force_ssl_admin()

    For a full report, I suggest you take a look at Plugin Inspector – https://wordpress.org/plugins/plugin-inspector/

    Best regards,
    Michael

    Kookidooki
    Participant

    Hello guys,

    How do I hide “+New” button,located at top bar, from members?

    I only want administrators getting access to add new postings, media, etc.

    I want something like this (I’m not a coder):

    if ( ! is_user_logged_in() ) {
    add_filter( ‘show_new’, ‘__return_false’ );
    }

    Thank You!

    #252295
    shanebp
    Moderator

    You mean group admins?

    I don’t think group admins can leave a group.

    To remove the ability to delete groups for everyone except site admins, try:

    function janhart_remove_group_admin_tab() {
    	if ( ! bp_is_group() || ! ( bp_is_current_action( 'admin' ) && bp_action_variable( 0 ) ) || is_super_admin() ) {	
    		return;
    	}
    
    	// Add the admin subnav slug you want to hide in the following array
    	$hide_tabs = array(
    		'delete-group' => 1,
    	);
    
    	$parent_nav_slug = bp_get_current_group_slug() . '_manage';
    
    	// Remove the nav items
    	foreach ( array_keys( $hide_tabs ) as $tab ) {
    		bp_core_remove_subnav_item( $parent_nav_slug, $tab );
    	}
    
    	// You may want to be sure the user can't access
    	if ( ! empty( $hide_tabs[ bp_action_variable( 0 ) ] ) ) {
    		bp_core_add_message( 'You are not allowed to delete this group.', 'error' );
    		bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) );
    	}
    }
    add_action( 'bp_actions', 'janhart_remove_group_admin_tab', 9 );

    The capabilities you want to adjust are not related to WP roles.

    damagomez
    Participant

    Hello, im having problems with the registration and activity pages on my website, im new at this, so i dont know if i’ve made a mistake and where i might have made it…

    I installed buddypress through wordpress plug-in search engine, and then went to settings and set up everything as i wanted, edited the profile fields as i needed, and then when i tried to visit the pages i only get the title of the page and the rest is blank, as if it where a normal page.

    I’ve been searching different forums about people having the same problem, but i haven’t been able to find a solution, they’ve either been posted a lot of years ago, or they just say solved and do not share how they solved it.
    If anyone can help, i will appreciate it a lot!!

    I have read the codex as many suggested, but it did not help because i did everything as it indicate to do it.
    I created the register and activate page and then assigned them under Settings/Buddypress/Pages, how the codex indicates so. (i did not edit in any way the pages, i only created and assigned them.
    I made sure that in Settings/General under membership the “anyone can register” is checked.
    I’ve checked if the register.php and activate.php files do exist.
    I read that it might be a bug, so i tried uninstalling this version (V2.5.2) and installing V2.5.1 and V2.3.5, just in case that would fix it…

    I truly don’t know what else to do.
    Its my first website and i do not know a lot of coding, im learning as i go.
    Could it be a bug in the plug-in? if so… how can i fix it?

    Just in case it helps, my host company is hostgator, WordPress is updated to the lates version, so is buddypress.

    I have the following plug-ins installed (i know they are a lot, but since i do not know how to code, i sort of need them…) :

    Admin Custom Login
    Black Studio TinyMCE Widget
    Black Studio Touch Dropdown Menu
    BP Registration Options
    BuddyPress
    BuddyPress Cover Photo
    BulletProof Security
    Confirm User Registration
    Contact Form 7
    Duplicate Post
    Hide Admin Bar From Non-admins
    Lightbox Plus Colorbox
    Meta Slider
    No Right Click Images Plugin
    Page Builder by SiteOrigin
    PMPro KISSmetrics
    Polylang
    Protect My Contents
    Quick Page/Post Redirect Plugin
    SB Welcome Email Editor
    SiteOrigin Widgets Bundle
    Spacer
    Title Remover
    Wordfence Security
    WordPress Access Control
    WP Bouncer
    WP Maintenance Mode

    Thanks in advance for your help!

    Kieran
    Participant

    I’m looking to set up moderation through my BuddyPress install. I’ve looked at the permissions and no matter what I try I seem to come up empty handed – any thoughts on what permissions I would give to a user to allow them to delete others activity from the front end. I will have my site set up in such a way that the user (any level other than super admin) cannot see the back end.

    Further, I have set up a user called flag, (I have hidden flag from being visible anywhere on the site, and when a user attempts to go to the URL they’re forwarded to the support page I have setup) I wish to have their notifications forwarded to anyone who has X role or to a set of user ID’s that can delete said post if it offends.

    I used the above code to achieve the hidden user https://buddypress.org/support/topic/hide-admin-from-members-and-activity/#post-190874

    Does anyone have any thoughts on this? I’m pretty stuck.

    Thanks,

    Kieran

    #251886
    giilour
    Participant

    hi – I have a multi author website and want people to be able to view authors profiles. I also have subscribers – is there a way to deny access for people to view subscribers profiles even if they type in the full web address and username?

    I found this code for admins and am using it atm – is there a way to have it for subs as well.

    // deny access to admins profile. User is redirected to the homepage
    function bpfr_hide_admins_profile() {
    global $bp;
    if(bp_is_profile && $bp->displayed_user->id == 1 && $bp->loggedin_user->id != 1) :
    wp_redirect( home_url() );
    exit;
    endif;
    }
    add_action( ‘wp’, ‘bpfr_hide_admins_profile’, 1 );

    gnosis123
    Participant

    I am wanting to hide the notification alert ( that sits in the admin bar ) when it has a 0 count. Tried many css but nothing works.

    .count no-alert {
    display:none!important;
    }

    graeme_bryson
    Participant

    I’m looking to exclude a single user ID from the main activity feed only. Directly above the main feed, I’m using a shortcode to pull in the latest post from this same single user, thus creating a ‘sticky’ post as this account only posts announcements. However, the code below seems to hide the user’s content across the entire site, so it doesn’t appear in either the shortcode-generate feed or the main feed.

    Essentially, is there a way I can specifically target the main buddypress activity feed only with this exclusion? Thanks in advance for any help you can provide.

    // hide admin's activities from all activity feeds
    function bpfr_hide_admin_activity( $a, $activities ) {
    
    	// ... but allow admin to see his activities!
    	if ( is_site_admin() )
    	return $activities;
    
    	foreach ( $activities->activities as $key => $activity ) {
    		// ID's to exclude, separated by commas. ID 1 is always the superadmin
    		if ( $activity->user_id == 784  ) {			
    
    			unset( $activities->activities[$key] );
    
    			$activities->activity_count = $activities->activity_count-1;
    			$activities->total_activity_count = $activities->total_activity_count-1;
    			$activities->pag_num = $activities->pag_num -1;
    		}
    	}
    	// Renumber the array keys to account for missing items
    	$activities_new = array_values( $activities->activities );
    	$activities->activities = $activities_new;
    
    	return $activities;
    
    }
    add_action( 'bp_has_activities', 'bpfr_hide_admin_activity', 10, 2 );
    #251280
    @mcuk
    Participant

    Yeah it’s possible 🙂 (assuming that the bit you are talking about is the one im thinking of haha).

    Two methods:

    1. CSS

    li#wp-admin-bar-site-name {
        display: none;
    }

    2. Add this to functions.php file

    function remove_site_name( $wp_admin_bar ) {
    	$wp_admin_bar->remove_node( 'site-name' );
    }
    add_action( 'admin_bar_menu', 'remove_site_name', 999 );

    Both will hide the word for both ALL users including admins (I prefer the second but its up to you).

    If you want to leave the word Pretitude there for admins only to access the dashboard then adding an if statement into the function (similar to the one in the remove_admin_bar() function) should work.

    Hope it works!

    #251278
    Georgio
    Participant

    Sorry, I didn’t explain it well: I want to keep the admin bar for non-admins (it is usefull for the notifications etc) but make disappear the word “Pretitude” (that gives access to dashboard).
    Well, after using your code, non-admins don’t have access to dashboard any more, but the word Pretitude stays visible and points to the home page. This word been now useless, I want to hide it for esthetical reasons, because it is near the logo and the whole thing is ungly. Is that possible?

    Thanks again for the code!

    #251238
    Georgio
    Participant

    With your code and the use of the plugin Better Admin Bar I have made a nice unobtrusive admin bar.
    Any idea how to hide/remove the dashboard link for NON-admins? Thanks.

    screenshot

    #251115
    shanebp
    Moderator

    Try:

    function bpfr_hide_admins_profile() {
    
    	if( bp_is_user() )
                if ( bp_displayed_user_id() == 1 && bp_loggedin_user_id() != 1 ) 
    		bp_core_redirect( home_url() );
    
    }
    add_action( 'wp', 'bpfr_hide_admins_profile', 1 );
Viewing 25 results - 226 through 250 (of 915 total)
Skip to toolbar