Search Results for 'Hide Admin'
-
AuthorSearch Results
-
June 26, 2016 at 11:02 am #255243
In reply to: Moving menu and Hiding admin bar
sharmavishal
Participant1. 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
June 16, 2016 at 2:23 pm #254641Masoud
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<?phpat 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?June 5, 2016 at 2:22 pm #254152danbp
Participantthank 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; ?>June 5, 2016 at 1:28 pm #254151Masoud
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.June 5, 2016 at 9:13 am #254149danbp
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 ! 😉
June 4, 2016 at 7:30 pm #254137danbp
ParticipantGive 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');May 10, 2016 at 3:08 pm #253283In reply to: [Resolved] How to Hide Admin accounts 2016?
semperaye
ParticipantThere 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.
April 10, 2016 at 1:13 pm #252295In reply to: Changing the capabilities of admin
shanebp
ModeratorYou 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.
March 29, 2016 at 7:39 am #251886Topic: deny access to subscriber profile
in forum How-to & Troubleshootinggiilour
Participanthi – 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 );March 15, 2016 at 5:10 pm #251280In reply to: How to make the admin bar transparent?
@mcuk
ParticipantYeah 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!
March 15, 2016 at 4:42 pm #251278In reply to: How to make the admin bar transparent?
Georgio
ParticipantSorry, 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!
March 15, 2016 at 5:15 am #251238In reply to: How to make the admin bar transparent?
Georgio
ParticipantWith 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.March 11, 2016 at 5:47 pm #251115In reply to: deny access to admins – PHP errors
shanebp
ModeratorTry:
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 );March 6, 2016 at 4:27 pm #250762In reply to: Hide activities of the administrator
@mcuk
ParticipantThis might help (change ID from 1 in the appropriate places to the ID of your administrator(s). ID’s found in your database ):
https://buddypress.org/support/topic/hide-all-admins-from-all-buddypress-activities/
March 5, 2016 at 8:27 pm #250727In reply to: Hide activities of the administrator
blogook
ParticipantHi,
You can use the code from buddydev. You just have to change one single thing
<?php //filter on pre_user_query add_action( 'pre_user_query', 'devb_exclude_loggedin_user', 201 ); function devb_exclude_loggedin_user( $query ) { // code below we do not need //don't modify the query if the user is not logged in // if ( !is_user_logged_in() ) // return; //do not hide users inside the admin if ( is_admin() && !defined('DOING_AJAX') ) return; $qv = $query->query_vars; global $wpdb; //hide little change at the end of the query.I changed it to user_id : 1 // but userID can be anything. I chose 1 because that is my admin user_id $query->query_where .= $wpdb->prepare(" AND {$wpdb->users}.ID !=%d ", 1 ); } ?>February 26, 2016 at 10:02 pm #250314RONO2
ParticipantHide Admin Bar Toolbar is what I used. I’m still trying to link my buddypress with my bbpress not going over well. LoL Hope this helps.
February 13, 2016 at 1:05 am #249827jino01
ParticipantSo there are two things I need to do:
1) Hide admin mentionname somehow
2) Members to have name and last name instead of the mentionname, maybe this will help with point 1?January 28, 2016 at 10:43 am #249233Kookidooki
ParticipantThank you!
It works fine, but when a (non-administrator) user is logged in, they cannot log out anymore because the logout button is missing which you can find in the “Howdy… [name][avatar][settings][logout button]” box at the upper right side. Also missing is the name of the user with his avatar, messages / notifications, etc. So this box is missing.
So what I need is a script that hides the admin bar on the front end when you’re logged out, but is visible when you’re logged in.
Any idea?
ThanX!
January 19, 2016 at 2:43 pm #248850In reply to: Hide field on registration
Slava Abakumov
ModeratorAll fields that are in the first
Basefields groups will appear on registration page.
So you can just move those fields to another fields group, that you can create on this page/wp-admin/users.php?page=bp-profile-setupusing this linkhttp://cosydale.com/wp-admin/users.php?page=bp-profile-setup&mode=add_group.Another option
Find the ID of a field that you want to hide in admin area (when you edit the field it’s in the URL like this
/wp-admin/users.php?page=bp-profile-setup&group_id=1&field_id=2&mode=edit_field=field_id=2is what you need), make sure that this field is NOT required, then open style.css of your theme and add there something like this:
#profile-details-section.register-section .editfield.field_2 {display:none}
For reference: http://take.ms/lONUDJanuary 5, 2016 at 10:15 pm #248412In reply to: Private Pages Glitch?
fscbmwcca
ParticipantI know the plugin doesn’t address my issue but keeps BuddyPress for members only and hide it from non-logged in users. Privacy is very important to our members. I will upload the members that are truly members from a csv file from a list that is provided for me and give the Contributor Role. What I meant by subscriber is the “Subscriber” Role (vs Contributor, Author, Editor, Administrator).
I’m sorry I haven’t expressed myself well and now off topic. I was just trying to provide a solution for making pages private.December 16, 2015 at 7:04 pm #247818buckyb
ParticipantThank you for replying, I tried to figure it out on my own, but I cant get it to work. I changed some of the lines, and included what you have, but it breaks the site. (still learning, please bear with me)
function bpfr_hide_profile_field_group( $retval ) { $displayed_user_level = some_s2_function( bp_displayed_user_id() ); if( is_super_admin() && $displayed_user_level == 'access_s2member_level1' ) { // exlude groups, separated by comma $retval['exclude_groups'] = '6,5'; } return $retval; } add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_field_group' );December 13, 2015 at 1:11 am #247706In reply to: Where to find code for “Create a Group” button
shanebp
ModeratorThe above is wrong – unless you are using the bp-default theme – not recommended.
‘Hide’ the Create a Group link by turning it off in Groups Settings > Group Creation
.../wp-admin/admin.php?page=bp-settingsDecember 5, 2015 at 8:20 am #247432In reply to: hide bp toolbar
dwsowash
ParticipantThis in you function php hides it from everyone but admins
//Removes BuddyBar from non-admins only function splen_remove_admin_bar() { if( !is_super_admin() ) add_filter( 'show_admin_bar', '__return_false' ); } add_action('wp', 'splen_remove_admin_bar');Is that what you mean?
November 10, 2015 at 9:59 am #246529In reply to: hiding groups and forums from members page
danbp
ParticipantTry
function bpfr_hide_tabs() { global $bp; /** * class_exists() & bp_is_active are recommanded to avoid problems during updates * or when Component is deactivated */ if( class_exists( 'bbPress' ) || bp_is_active ( 'groups' ) ) : if ( bp_is_user() && !is_super_admin() && !bp_is_my_profile() ) { bp_core_remove_nav_item( 'groups' ); bp_core_remove_nav_item( 'forums' ); bp_core_remove_subnav_item( 'activity', 'groups' ); } endif; } add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );November 10, 2015 at 9:58 am #246528In reply to: Want to add new tab in buddypress profile page.
danbp
Participanttry this:
function bpfr_hide_tabs() { global $bp; /** * class_exists() & bp_is_active are recommanded to avoid problems during updates * or when Component is deactivated */ if( class_exists( 'bbPress' ) || bp_is_active ( 'groups' ) ) : if ( bp_is_user() && !is_super_admin() && !bp_is_my_profile() ) { bp_core_remove_nav_item( 'groups' ); bp_core_remove_nav_item( 'forums' ); bp_core_remove_subnav_item( 'activity', 'groups' ); } endif; } add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 ); -
AuthorSearch Results