Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'Hide Admin'

Viewing 25 results - 51 through 75 (of 691 total)
  • Author
    Search Results
  • #310816

    In reply to: /Members’ slug

    globsticks
    Participant

    it worked!

    Hi Brajesh,

    My website does have a registration page, so users have to click on the logout link at some point.
    I am hiding the admin page via secret Login Slug, but I noticed that users can read its value from the URL when they log out. ¿do you happen to know how to I hide the Login Slug from logout URL please?

    !Thank you!

    Hide Login Slug value on Logout

    #310423
    vinem
    Participant

    Hi there,

    I’ve seen a lot of people asking this but no one provided a good solution to do so.
    So, is there a way to hide the admin profile from other members ?
    I don’t want my activities to appear in the stream or people to have access to my admin profile.

    I tried a bunch of plugins and code lines I found through Google but nothing worked.

    Thank you!

    #310282
    stephenss
    Participant

    Hi Everyone,

    Need your help.

    How do I hide Admins from the search Members list on the frontend using BuddyPress?

    Regards
    Stephen

    #309830
    bmcconach
    Participant

    Howdy, BuddyPress friends!

    I have been working on a project for fun and have been enjoying the laying out of items and adding plugin functionality a bit much here lately. So much so, in fact, that I put the testing phase on the back shelf for a bit.

    When I was attempting to request membership from a test account to a private group that my admin account was the creator of, I ran into an issue: I can get to the request page (/groups/test-group/request-membership/?_wpnonce=47febc75fe) by clicking the link to do so and then am presented with a textarea for request comments, however when I submit the form (with or without comments) I am taken back to the group’s main page (/groups/test-group/) and am presented with “There was an error sending your group membership request. Please try again.” The request does not come through (not in BP’s notifications, e-mail, pending requests, etc.) at all.

    At first this was a minor irritation because I could go to the group as the admin and invite the test account to join the group. There I am presented with a checkbox for my test account’s name, as well as a submit button; however when clicking on the checkbox, the form instantly submits without ever sending an invite. I even attempted to modify the live source to set the field to checked, attempted to submit, and received a success message stating my invite was sent, but of course it never was.

    I have checked the list of plugins I have on my site, disabled a few I didn’t necessarily need, and have checked each of the remaining to see if there’s any sort of conflict between plugins affecting groups, but to no avail. This functionality is key to the use of groups for my project, so I would sincerely appreciate any advice from more knowledgeable members of the BP community.

    Some support information, including a list of active plugins, can be found below. Please note that any plugin with ** beside it came bundled with the theme.

    == Server Environment ==
    	Operating System: Linux
    	Software: Apache/2.4.6
    	MySQL version: MariaDB Server v5.5.61-MariaDB-38.13
    	PHP Version: 7.2.24
    	PHP Max Input Vars: 2500
    	PHP Max Post Size: 64M
    	GD Installed: Yes
    	ZIP Installed: Yes
    	Write Permissions: All right
    	Elementor Library: Connected
    
    == WordPress Environment ==
    	Version: 5.3.2
    	WP Multisite: No
    	Max Upload Size: 64 MB
    	Memory limit: 512M
    	Permalink Structure: /%postname%/
    	Language: en-US
    	Timezone: America/New_York
    	Debug Mode: Inactive
    
    == Theme ==
    	Name: Gwangi
    	Version: 2.1.1
    	Author: Themosaurus
    	Child Theme: No
    
    == User ==
    	Role: administrator
    	WP Profile lang: en_US
    	User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36
    
    == Active Plugins ==
    	(BuddyDev) BP Auto Login on Activation
    		Version: 1.0.3
    		Author: Brajesh Singh
    
    	Author Avatars List**
    		Version: 1.18
    		Author: Paul Bearne
    
    	Awesome Weather Widget
    		Version: 3.0.2
    		Author: Hal Gatewood
    
    	bbPress
    		Version: 2.6.3
    		Author: The bbPress Contributors
    
    	BP Messages Tool
    		Version: 2.1
    		Author: PhiloPress
    
    	BP Profile Search
    		Version: 5.2.4
    		Author: Andrea Tarantini
    
    	BuddyPress
    		Version: 5.1.2
    		Author: The BuddyPress Community
    
    	BuddyPress Default Cover Photo
    		Version: 1.6.0
    		Author: SeventhQueen
    
    	BuddyPress Extended Friendship Request
    		Version: 1.2.0
    		Author: BuddyDev Team
    
    	BuddyPress Reorder Tabs
    		Version: 2.0.1
    		Author: BuddyBoss
    
    	BuddyPress Xprofile Custom Field Types
    		Version: 1.1.3
    		Author: BuddyDev
    
    	Classic Editor
    		Version: 1.5
    		Author: WordPress Contributors
    
    	Classic Editor Addon
    		Version: 2.6.0
    		Author: Pieter Bos, Greg Schoppe
    
    	Dashboard Notepad
    		Version: 1.42
    		Author: Stephanie Leary
    
    	Easy Custom Sidebars**
    		Version: 1.0.10
    		Author: Titanium Themes
    
    	Elementor**
    		Version: 2.8.3
    		Author: Elementor.com
    
    	Envato Market
    		Version: 2.0.3
    		Author: Envato
    
    	Essential Addons for Elementor
    		Version: 3.7.1
    		Author: WPDeveloper
    
    	Grimlock**
    		Version: 1.2.5
    		Author: Themosaurus
    
    	Grimlock Animate**
    		Version: 1.1.0
    		Author: Themosaurus
    
    	Grimlock for Author Avatars List**
    		Version: 1.0.4
    		Author: Themosaurus
    
    	Grimlock for bbPress**
    		Version: 1.0.3
    		Author: Themosaurus
    
    	Grimlock for BuddyPress**
    		Version: 1.1.4
    		Author: Themosaurus
    
    	Grimlock for Elementor**
    		Version: 1.0.1
    		Author: Themosaurus
    
    	Grimlock for Jetpack**
    		Version: 1.0.4
    		Author: Themosaurus
    
    	Grimlock for Testimonials by WooThemes**
    		Version: 1.1.0
    		Author: Themosaurus
    
    	Grimlock for The Events Calendar**
    		Version: 1.1.2
    		Author: Themosaurus
    
    	Grimlock Hero**
    		Version: 1.0.7
    		Author: Themosaurus
    
    	Grimlock Isotope**
    		Version: 1.0.7
    		Author: Themosaurus
    
    	Grimlock Login**
    		Version: 1.0.10
    		Author: Themosaurus
    
    	Hide Admin Bar
    		Version: 0.3.9.9
    		Author: Shelby DeNike
    
    	If Menu - Visibility control for menu items
    		Version: 0.15
    		Author: Layered
    
    	Kirki Customizer Framework**
    		Version: 3.0.45
    		Author: Ari Stathopoulos
    
    	MediaPress
    		Version: 1.4.6
    		Author: BuddyDev
    
    	Menu Image**
    		Version: 2.9.5
    		Author: Rui Guerreiro
    
    	Simple Buddypress Profile Privacy
    		Version: 0.7.9
    		Author: Justin Hansen
    
    	Social Articles
    		Version: 2.9.5
    		Author: Broobe
    
    	The Events Calendar
    		Version: 4.9.14
    		Author: Modern Tribe, Inc.
    
    	UpdraftPlus - Backup/Restore
    		Version: 1.16.21
    		Author: UpdraftPlus.Com, DavidAnderson
    
    	Verified Member for BuddyPress**
    		Version: 1.1.1
    		Author: Themosaurus
    
    == Must-Use Plugins ==
    	Gateway Relay
    		Version: 1.0
    		Author: Arnold Bailey (Incsub)
    
    	rms_unique_wp_mu_pl_fl_nm.php
    		Version: 
    		Author: 
    
    	WPMU Assist
    		Version: 1.0.2
    		Author: Arnold Bailey (Incsub)
    
    == Elements Usage ==
    	
    	wp-page : 12
    		eael-adv-tabs : 1
    		google_maps : 1
    		image-carousel : 1
    		shortcode : 1
    		text-editor : 1
    		wp-widget-grimlock_author_avatars_section_widget : 1
    		wp-widget-grimlock_posts_section_widget : 1
    		wp-widget-grimlock_query_section_widget : 1
    		wp-widget-grimlock_section_widget : 3
    		wp-widget-grimlock_the_events_calendar_tribe_events_section_widget : 1
    
    == Log ==
    	
    PHP: showing 1 of 1PHP: 2020-01-02 10:43:38 [error X 1][/home/*****/public_html/wp-content/plugins/elementor/elementor.php::97] Cannot redeclare elementor_fail_wp_version() (previously declared in /home/*****/public_html/wp-content/plugins/elementor/elementor.php:97) [array (
      'trace' => '
    #0: Elementor\Core\Logger\Manager -> shutdown()
    ',
    )]
    
    JS: showing 1 of 1JS: 2020-01-11 16:50:05 [error X 1][https://*****/wp-content/plugins/grimlock/assets/js/navigation-stick-to-top.js?ver=1.2.5:27:45] Cannot read property \'top\' of undefined
    todga
    Participant

    Hello,
    Please, how can I hide all members in buddypress to members, so that members can only see their friends in own profile?
    Only admin can see all members.
    Also hide all groups, all newest groups, all new groups, all new members, all groups memberships, all friendships.
    Only admin can see all them.
    Like in Facebook where users can not see all users except their friends.
    Thanks.

    #307760
    beat sk
    Participant

    Hello,

    I have a question about buddypress profile menu. How can i make a link in the menu only for userroles? Something like “Go to administration” in the profile menu – Profile, Activity, Groups, Messages ? Is there a chance to add this only for user roles and admins? Register and Login working on front-end and we want hide /wp-admin from others. Thank you.

    #307742
    todga
    Participant

    Hello,
    Please, is there a plugin that can hide all members in buddypress to members, so that members can only see their friends in own profile?
    Only admin can see all members.
    Also hide all groups, newest groups, new groups, new members, groups memberships, friendships.
    Only admin can see all them.
    Thanks.

    #306977
    beat sk
    Participant

    Hello,

    I have a question about buddypress profile menu. How can i make a link in the menu only for userroles? Something like “Go to administration” in the profile menu – Profile, Activity, Groups, Messages ? Is there a chance to add this only for user roles and admins? Register and Login working on front-end and we want hide /wp-admin from others. Thank you for positive/negative feedback.

    #306908
    beat sk
    Participant

    Hello again friends. 🙂

    Now I have a question about buddypress profile menu. How can i make a link in the menu only for userroles? Something like “Go to administration” in the profile menu – Profile, Activity, Groups, Messages ? Is there a chance to add this only for user roles and admins? The website is built to hide we are using wordpress in front of people. Register and Login working on front-end and we want hide /wp-admin from others. Thank you for positive/negative feedback.

    #306826
    chris19731973
    Participant
    <?php
    
    /**
     * Listing detail Page.
     *
     * @link    https://pluginsware.com
     * @since   1.0.0
     *
     * @package Advanced_Classifieds_And_Directory_Pro
     */
     
    // Exit if accessed directly
    if ( ! defined( 'WPINC' ) ) {
    	die;
    }
    
    /**
     * ACADP_Public_Listing Class.
     *
     * @since 1.0.0
     */
    class ACADP_Public_Listing {
    	
    	/**
    	 * Filter the post content.
    	 *
    	 * @since  1.5.4
    	 * @param  string $html The post thumbnail HTML.
    	 * @return string $html Filtered thumbnail HTML.
    	 */
    	public function post_thumbnail_html( $html ) {	
    		if ( is_singular( 'acadp_listings' ) ) {
    			return '';
    		}
    		
    		return $html;		
    	}
    	
    	/**
    	 * Filter the post content.
    	 *
    	 * @since  1.0.0
    	 * @param  string $content Content of the current post.
    	 * @return string $content Modified Content.
    	 */
    	public function the_content( $content ) {		
    		if ( is_singular( 'acadp_listings' ) && in_the_loop() && is_main_query() ) {		
    			global $post;
    			
    			acadp_update_listing_views_count( $post->ID );
    			
    			$general_settings      = get_option( 'acadp_general_settings' );
    			$recaptcha_settings    = get_option( 'acadp_recaptcha_settings' );	
    			$registration_settings = get_option( 'acadp_registration_settings' );
    
    			$post_meta = get_post_meta( $post->ID );
    			
    			$description = $content;
    					
    			$can_show_date         = isset( $general_settings['display_options'] ) && in_array( 'date', $general_settings['display_options'] )  ? true : false;
    			$can_show_user         = isset( $general_settings['display_options'] ) && in_array( 'user', $general_settings['display_options'] )  ? true : false;
    			$can_show_views        = isset( $general_settings['display_options'] ) && in_array( 'views', $general_settings['display_options'] ) ? true : false;
    			$can_show_contact_form = empty( $general_settings['has_contact_form'] ) ? false : true;	
    			$can_add_favourites    = empty( $general_settings['has_favourites'] )   ? false : true;
    			$can_report_abuse      = empty( $general_settings['has_report_abuse'] ) ? false : true;
    			$has_widgets           = acadp_has_active_listing_widgets();
    			$has_sidebar           = ! $has_widgets;
    			
    			// $login_url
    			$current_page_url = get_permalink();
    			$login_url        = acadp_get_user_login_page_link( $current_page_url );
    			
    			// $location
    			$has_location = empty( $general_settings['has_location'] ) ? false : true;
    			$can_show_location = false;
    			
    			if ( $has_location ) {
    				$location = wp_get_object_terms( $post->ID, 'acadp_locations' );
    			
    				if ( ! empty( $location ) ) {
    					$location = $location[0];
    					$can_show_location = true;
    				}
    			}
    			
    			// $category
    			$has_category = false;
    			$can_show_category = isset( $general_settings['display_options'] ) && in_array( 'category', $general_settings['display_options'] ) ? true : false;
    			$can_show_category_desc = isset( $general_settings['display_options'] ) && in_array( 'category_desc', $general_settings['display_options'] ) ? true : false;
    			$categories = wp_get_object_terms( $post->ID, 'acadp_categories' );
    			
    			if ( empty( $categories ) ) {
    				$can_show_category = false;
    			} else {
    				$category = $categories[0];
    				$has_category = true;
    			}
    			
    			// $can_show_images
    			$has_images = empty( $general_settings['has_images'] ) ? false : true;
    			$can_show_images = false;
    			
    			if ( $has_images ) {
    				$can_show_images = isset( $post_meta['images'] ) ? true : false;
    			}
    			
    			// $can_show_video
    			$has_video = empty( $general_settings['has_video'] ) ? false : true;
    			$can_show_video = false;
    			$video_url = '';
    			
    			if ( $has_video ) {
    				if ( ! empty( $post_meta['video'][0] ) ) {
    					$video_url = acadp_parse_videos( $post_meta['video'][0] );	
    					$can_show_video = empty( $video_url ) ? false : true;				
    				}				
    			}
    			
    			// $can_show_map
    			$has_map = ! empty( $general_settings['has_map'] ) && empty( $post_meta['hide_map'][0] ) ? true : false;
    			$can_show_map = false;
    		
    			if ( $can_show_location && $has_map ) {			
    				$can_show_map = ! empty( $post_meta['latitude'][0] ) && ! empty( $post_meta['longitude'][0] ) ? true : false;
    			}
    
    			// $can_show_price
    			$has_price = empty( $general_settings['has_price'] ) ? false : true;
    			$can_show_price = false;
    		
    			if ( $has_price && isset( $post_meta['price'] ) && $post_meta['price'][0] > 0 ) {
    				$can_show_price = true;
    			}
    			
    			// Get custom fields
    			$fields = array();
    			$category_ids = array();
    
    			foreach ( $categories as $category ) {
    				$category_ids[] = $category->term_id;
    			}
    
    			$custom_field_ids = acadp_get_custom_field_ids( $category_ids );	
    					
    			if ( ! empty( $custom_field_ids ) ) {
    				$args = array(
    					'post_type' => 'acadp_fields',
    					'post_status' => 'publish',
    					'posts_per_page' => 500,	
    					'post__in' => $custom_field_ids,
    					'no_found_rows' => true,
    					'update_post_term_cache' => false,	
    					'meta_key' => 'order',
    					'orderby' => 'meta_value_num',				
    					'order' => 'ASC'
    				);
    				
    				$acadp_query = new WP_Query( $args );
    
    				if ( $acadp_query->have_posts() ) {
    					$fields = $acadp_query->posts;
    				}
    			}
    
    			// Process output
    			ob_start();
    			do_action( 'acadp_before_listing_content' );
    			include( acadp_get_template( "listing/acadp-public-listing-display.php" ) );
    			do_action( 'acadp_after_listing_content' );
    			$content = ob_get_clean();		
    		}
    		
    		return $content;		
    	}
    	
    	/**
    	 * Add or Remove favourites.
    	 *
    	 * @since 1.0.0
    	 */
    	public function ajax_callback_add_remove_favorites() {	
    		check_ajax_referer( 'acadp_ajax_nonce', 'security' );
    
    		$post_id = (int) $_POST['post_id'];
    		
    		$favourites = (array) get_user_meta( get_current_user_id(), 'acadp_favourites', true );
    		
    		if ( in_array( $post_id, $favourites ) ) {			
    			if ( ( $key = array_search( $post_id, $favourites ) ) !== false ) {
        			unset( $favourites[ $key ] );
    			}
    		} else {
    			$favourites[] = $post_id;
    		}
    		
    		$favourites = array_filter( $favourites );
    		$favourites = array_values( $favourites );
    		
    		delete_user_meta( get_current_user_id(), 'acadp_favourites' );
    		update_user_meta( get_current_user_id(), 'acadp_favourites', $favourites );
    		
    		the_acadp_favourites_link( $post_id );
    		
    		wp_die();	
    	}
    	
    	/**
    	 * Report Abuse.
    	 *
    	 * @since 1.0.0
    	 */
    	public function ajax_callback_report_abuse() {	
    		check_ajax_referer( 'acadp_ajax_nonce', 'security' );
    
    		$data = array( 'error' => 0 );
    		
    		if ( acadp_is_human('report_abuse') ) {		
    			if ( acadp_email_admin_report_abuse() ) {			
    				$data['message'] = __( 'Your message sent successfully.', 'advanced-classifieds-and-directory-pro' );				
    			} else {				
    				$data['error']   = 1;
    				$data['message'] = __( 'Sorry! Please try again.', 'advanced-classifieds-and-directory-pro' );				
    			}			
    		} else {		
    			$data['error']   = 1;
    			$data['message'] = __( 'Invalid Captcha: Please try again.', 'advanced-classifieds-and-directory-pro' );			
    		}
    				
    		echo wp_json_encode( $data );
    		wp_die();	
    	}
    	
    	/**
    	 * Send contact email.
    	 *
    	 * @since 1.0.0
    	 */
    	public function ajax_callback_send_contact_email() {	
    		check_ajax_referer( 'acadp_ajax_nonce', 'security' );
    		
    		$data = array( 'error' => 0 );
    		
    		if ( acadp_is_human('contact') ) {		
    			if ( acadp_email_listing_owner_listing_contact() ) {			
    				// Send a copy to admin( only if applicable ).
    				acadp_email_admin_listing_contact();
    				
    				$data['message'] = __( 'Your message sent successfully.', 'advanced-classifieds-and-directory-pro' );				
    			} else {				
    				$data['error']   = 1;
    				$data['message'] = __( 'Sorry! Please try again.', 'advanced-classifieds-and-directory-pro' );				
    			}			
    		} else {		
    			$data['error']   = 1;
    			$data['message'] = __( 'Invalid Captcha: Please try again.', 'advanced-classifieds-and-directory-pro' );			
    		}
    			
    		echo wp_json_encode( $data );	
    		wp_die();	
    	}
    
    }
    
    #306439
    xailaes
    Participant

    Hello

    I need help to hide administrators in member widget.

    I have a code that hides the administrators from the member list but they keep appearing in the members widget, active users and online users

    Thank you

    #306086
    jennifersanchez
    Participant

    Hi.

    Im using this code to hide the tabs in the profile’s visitor

    function bpfr_hide_tabs() {
    global $bp;
    
    	
    
    	if( class_exists( 'bbPress' ) || bp_is_active ( 'groups' ) ) :
            
           
    	if ( bp_is_user() && !is_super_admin() && !bp_is_my_profile() ) {
    
          
    		bp_core_redirect( get_option('home') . '/members/' .  bp_core_get_user(). '/reviews' );
    		bp_core_remove_nav_item( 'friends' );
    		bp_core_remove_nav_item( 'groups' );
    	bp_core_remove_nav_item( 'activity' );
    	}
    	endif;
    }
    add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );

    but the line
    bp_core_redirect( get_option('home') . '/members/' . bp_core_get_user( ). '/reviews' ); dont works.
    i tried with this ('BP_DEFAULT_COMPONENT','reviews'); but this dont works..

    Thanks very much!!

    #304950
    Venutius
    Moderator

    If you go to Appearance/Menus in WP Admin, you should be able to edit the menu and delete those links. While you are there, click on Page Options on the top right of the page and make sure BuddyPress is checked.

    Note: it looks like you have multiple menus so you will have to select the correct menu to edit.

    Then you should see the BuddyPress menu links meta-box and you will see there’s a login link you can add to the menu. That should sort out your BuddyPress login, same with Register.

    I’ve got a site buddyuser dot com, I’ve created a beginners introduction to BuddyPress, you might want to take a look at that.

    It’s possible to hide menu links that you don’t want the general public to know about. There’s a few plugins that do this but one I use is https://wordpress.org/plugins/nav-menu-roles/ this adds a handy checkbox to allow you to stipulate who can see that menu item.

    thecomputergi
    Participant

    Hello,
    I was wondering if there is a plugin, or bit of code I could remove or add to make it where there is no possible way for me to see user’s private messages. Right now I can use the Export Personal Data tool or go to their profiles and click messages. I want to disable both of these features permanently.
    Thanks!

    #304339
    Venutius
    Moderator

    Hi there,

    My suggestion is that you add a new menu item “All” and create a new set of queries for the page then make that page the default landing page for the profile activity page. Here’s my code to do this:

    function bpex_set_member_default_nav() {
     
    		if ( ! bp_is_user_profile() && ! bp_is_user_activity() && ! bp_is_user() ) {
    		    return;
    	         }
    
                    bp_core_new_nav_default(
    		array(
    			'parent_slug'       => buddypress()->activity->id,
    		// other "activity" sub_nav slugs : personal favorites friends groups mentons
    			'subnav_slug'       => 'all-activity',
    			'screen_function'   => 'bp_activity_screen_all_activity'
    		)
    	);
    }
    add_action( 'bp_setup_nav', 'bpex_set_member_default_nav', 20 );
    
    add_action( 'bp_setup_nav', 'bpex_just_me_tab', 50 );
    add_action( 'bp_setup_admin_bar', 'bpex_admin_bar_add', 50 );
    
    function bpex_just_me_tab() {
    	
    	if ( ! bp_is_user_profile() && ! bp_is_user_activity() && ! bp_is_user() ) {
    		return;
    	}
    	
    	global $bp;
    	$user_id = bp_displayed_user_id();
    	
    		bp_core_new_subnav_item( array(
    			'name'            => _x( 'All', 'Profile activity screen sub nav', 'buddypress' ),
    			'slug'            => 'all-activity',
    			'parent_url'      => bp_core_get_user_domain( $user_id ) . 'activity/',
    			'parent_slug'     => 'activity',
    			'screen_function' => 'bp_activity_screen_all_activity',
    			'position'        => 10
    		) );
    
    }
    
    function bpex_admin_bar_add() {
    	
    	global $wp_admin_bar, $bp;
    
    	if ( ! bp_use_wp_admin_bar() || defined( 'DOING_AJAX' ) ) {
    		return false;
    	}
    
    	$user_id = get_current_user_id();
    	
    	if ( ! $user_id || $user_id == 0 || ! is_numeric( $user_id ) ) {
    		return;
    	}
    	
    	// Personal.
    	//$wp_admin_bar->remove_menu( 'my-account-activity-personal', 'my-account-activity' );
    
    	$wp_admin_bar->add_menu( array(
    		'parent'   => 'my-account-activity',
    		'id'       => 'my-account-activity-all-activity',
    		'title'    => 'All',
    		'href'     => bp_core_get_user_domain( $user_id ) . 'activity/all-activity/',
    		'position' => 10
    	) );
    }
    function bp_activity_screen_all_activity() {
    
    	do_action( 'bp_activity_screen_all_activity' );
    
    	bp_core_load_template( apply_filters( 'bp_activity_template_all_activity', 'members/single/home' ) );
    }
    
    function bp_activity_filter_all_activity_scope( $retval = array(), $filter = array() ) {
    
    	// Determine the user_id.
    	if ( ! empty( $filter['user_id'] ) ) {
    		$user_id = $filter['user_id'];
    	} else {
    		$user_id = bp_displayed_user_id()
    			? bp_displayed_user_id()
    			: bp_loggedin_user_id();
    	}
    
    	// Should we show all items regardless of sitewide visibility?
    	$show_hidden = array();
    	if ( ! empty( $user_id ) && $user_id !== bp_loggedin_user_id() ) {
    		$show_hidden = array(
    			'column' => 'hide_sitewide',
    			'value'  => 0
    		);
    	}
    
    	// Determine groups of user.
    	$groups = groups_get_user_groups( $user_id );
    	if ( empty( $groups['groups'] ) ) {
    		$groups = array( 'groups' => 0 );
    	}
    
    	// Determine the favorites.
    	$favs = bp_activity_get_user_favorites( $user_id );
    	if ( empty( $favs ) ) {
    		$favs = array( 0 );
    	}
    
    	// Determine friends of user.
    	$friends = friends_get_friend_user_ids( $user_id );
    	if ( empty( $friends ) ) {
    		$friends = array( 0 );
    	}
    
    	$retval = array(
    		'relation' => 'OR',
    		array(
    			'relation' => 'AND',
    			array(
    				'column'  => 'user_id',
    				'compare' => 'IN',
    				'value'   => (array) $friends
    			)
    		),
    		array(
    			'relation' => 'AND',
    			array(
    				'column' => 'component',
    				'value'  => buddypress()->groups->id
    			),
    			array(
    				'column'  => 'item_id',
    				'compare' => 'IN',
    				'value'   => (array) $groups['groups']
    			)
    		),
    		array(
    			'relation' => 'AND',
    			array(
    				'column' => 'user_id',
    				'value'  => $user_id
    			)
    		),
    		array(
    			'relation' => 'AND',
    			array(
    				'column'  => 'id',
    				'compare' => 'IN',
    				'value'   => (array) $favs
    			)
    		),
    		array(
    			'relation' => 'AND',
    			array(
    				'column'  => 'content',
    				'compare' => 'LIKE',
    
    				// Start search at @ symbol and stop search at closing tag delimiter.
    				'value'   => '@' . bp_activity_get_user_mentionname( $user_id ) . '<'
    			)
    		),
    		// We should only be able to view sitewide activity content for friends.
    		array(
    			'column' => 'hide_sitewide',
    			'value'  => 0
    		),
    
    		// Overrides.
    		'override' => array(
    			'filter'      => array( 'user_id' => 0 ),
    			'show_hidden' => true
    		),
    	);
    	
    
    	return $retval;
    }
    add_filter( 'bp_activity_set_all-activity_scope_args', 'bp_activity_filter_all_activity_scope', 10, 2 );

    Once you have done that you would also want to overload the buddypress/bp-templates/your-template/members/single/activity.php to make sure this new page contains the post update form:

    Change:

    if ( is_user_logged_in() && bp_is_my_profile() && ( !bp_current_action() || bp_is_current_action( 'just-me' ) ) )
    	bp_get_template_part( 'activity/post-form' );

    To:

    if ( is_user_logged_in() && bp_is_my_profile() && ( !bp_current_action() || bp_is_current_action( 'all-activity' ) ) )
    	bp_get_template_part( 'activity/post-form' );
    

    Note: with this method there is a danger of duplicating activity since a friend posting to a group would show up in the groups search as well as the friends search etc. so you may want to adjust the $retval criteria.

    Also you might want to add a post form for visiting users so they can leave a comment for the user, you could ad this:

    function bpex_load_mention_me() {
    	
    	if ( get_current_user_id() != bp_displayed_user_id() ) {
    		$_GET['r'] = bp_activity_get_user_mentionname( bp_displayed_user_id() );
    		bp_get_template_part( 'activity/post-form' );
    	}
    
    }
    
    add_action( 'bp_before_member_body', 'bpex_load_mention_me' );
    #303892

    In reply to: WordPress Dashboard

    Venutius
    Moderator

    The basic option is to set up a redirect for anyone but admin, that would involve adding some code to your functions.php. There’s probably plugins that d it, but it’s quite simple with code if you are happy with that.

    That would not stop links from appearing in the WordPress admin-bar / toolbar. Would you still want to give them access to the BuddyPress menu options via the toolbar?

    I’ve recently launched a BP specific Front End editor and I’ve included all the various hide admin code in that. You can choose to hide the admin-bar altogether or prune out the menu items you don’t want to display, such as the +New menu item.

    melodynest
    Participant

    First time poster! Hello everyone 🙂

    I am using: Marketplace One Social theme, WC Vendors, Woocommerce, BP Better messages (websocket upgrade).

    Is there a way to make the ability to start conversations only for admin? I am designing a freelancer type website where I only want the Admin to be able to connect buyers and sellers into a private conversation after the purchase has been made (to avoid circumvention). I want vendors and subscribers to have access to their messages, just not the ability to start a new one.

    I am thinking maybe CSS to hide compose features? Could that be the easiest solution?

    Thanks in advance for any ideas!

    #302952
    shanebp
    Moderator
    function bpfr_hide_admins_profile() {
    	
        $admin_ids = array( 1, 22, 48 );
    	
        if( bp_is_user() ) {
    	if ( in_array( bp_displayed_user_id(), $admin_ids ) && ! in_array( bp_loggedin_user_id(), $admin_ids ) ) {
    		bp_core_redirect( site_url() );
            }
        }
    	
    }
    add_action( 'bp_ready', 'bpfr_hide_admins_profile', 1 );
    #302946
    Kristian Yngve
    Participant

    It all works, thank you so much @shanebp!

    so if there are more than one admin profiles, i can just use commas?

    for eg:

    function bpfr_hide_admins_profile() {
         if( bp_is_user() && bp_displayed_user_id() == 1,2,3 && bp_loggedin_user_id() != 1,2,3 ) {
    	bp_core_redirect( site_url() );
         }
    }
    add_action( 'bp_ready', 'bpfr_hide_admins_profile', 1,2,3 );
    

    This to do like that correct?

    #302945
    shanebp
    Moderator

    I’m surprised that your code ever worked.

    Try:

    function bpfr_hide_admins_profile() {
         if( bp_is_user() && bp_displayed_user_id() == 1 && bp_loggedin_user_id() != 1 ) {
    	bp_core_redirect( site_url() );
         }
    }
    add_action( 'bp_ready', 'bpfr_hide_admins_profile', 1 );

    Of course – this assumes that there is only one site admin and the user_id for that admin is 1.

    #302941
    Kristian Yngve
    Participant

    Even after removing all probably issues in my plugins, functions and bp-custim.php, I can’t seem to get the ‘Deny access to admins profile not working’ to work:

    //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 );

    I have everything up to date as much as possible.

    Any ideas?

    Have also tried: bp_is_user()

    many thanks

    #302939
    sitesfromash
    Participant

    Hi. I noticed that the three options which BuddyPress offers in regards to field visibility is “Only Me”, “Friends Only”, and “Everyone”. If someone sets their preference of a field to “Only Me” or “Friends Only”, is it still possible for the admin to see it? If not, is there a method that I can implement to see it as an admin but to hide it to other members? Also, can I put this field into an additional column on the Users Admin Panel? Thanks for any assistance which you can provide me.

    #302676
    natiaz
    Participant

    Ok, I thought that.

    So basically I’m going to need to grant user manage_options capability and then hide every every admin menu except the groups one.

    Thanks!

    #302438
    msteimann
    Participant

    Thanks for your quick reply, Venutius!

    I have tried the WP 2015 Theme and got the same results. So I switched back to KLEO and noticed, that the xProfile fields do change to the desired visibility settings, AFTER the user clicks the SAVE SETTINGS button. So I guess I was confused by the fact that BEFORE you hit the save button there is a misleading visual feedback (the visibility term does not alter to the according setting the user has just changed it to, it still displays the same value as before).

    Could this be changed in the next release?

    My first problem still remains: the „change display name visibility option“ is displayed beneath the name field on the user Registration page. This doesn’t make sense, if the name’s visibility throughout BuddyPress network is mandatory. How can I get rid of this line? Does this line and it’s user changeable visibility options really not appear on a default install?

    In the WP Dashboard I cannot change the options for the primary Name field. Only the fields under the details tab can be altered by admin and set to be visibility-changeable by the user. (Hope you understand what I try to say 😉

    Regards,
    Martin

    Hide visibility option on registration page?

    #302398
    Artyom
    Participant

    Another question: i want to hide group menu for members (non-admins). How i can check user for group admin? I want to add a check before a template of menu. Something like – if(“check expression”) {menu code}. I need a check expression. Thank you!

Viewing 25 results - 51 through 75 (of 691 total)
Skip to toolbar