Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'Hide Admin'

Viewing 25 results - 251 through 275 (of 634 total)
  • Author
    Search Results
  • #193476
    danbp
    Participant

    @jessicana,

    The field NAME in the field group BASE is required. This group is used for the registration page to work. As you already know, it’s also this group who allows you to show custom fields on the registration page.
    The NAME field in BuddyPress is intended to receive first and last name and replace the two original fields (first name, last name) coming with WordPress.

    That said, you can hide this field to users, but you can’t give them the choice to show/hide it.

    The above snippet will hide the field NAME to all visitors/members, but not to site admin and the concerned profile.

    function bpfr_make_name_members_only( $retval ) {	
    	//hold all of our info
    	global $bp;
    	
    	// is xprofile component active ?	
    	if ( bp_is_active( 'xprofile' ) )
    	
        // The user ID of the currently logged in user
        $current_user_id = (int) trim($bp->loggedin_user->id);
    	
        // The author that we are currently viewing
        $author_id  = (int) trim($bp->displayed_user->id);
    	
    	// user can see only his name && admin can see everyone 
    	if ($current_user_id !== $author_id && !current_user_can('delete_others_pages') ) {
    		$retval['exclude_fields'] = '1';	
    	}
    	return $retval;	
    }
    add_filter( 'bp_after_has_profile_parse_args', 'bpfr_make_name_members_only' );

    Add this to your child-theme functions.php or to bp-custom.php

    #190941
    aghajoon
    Participant

    this code work for me but java script not work and when user favorite comment user can’t remove notification help me

    define("BP_FAVORITE_NOTIFIER_SLUG","fa_notification");
    
        function bp_favorite_setup_globals() {	
    	global $bp, $current_blog;
        $bp->bp_favorite=new stdClass();
        $bp->bp_favorite->id = 'bp_favorite';
        $bp->bp_favorite->slug = BP_FAVORITE_NOTIFIER_SLUG;
        $bp->bp_favorite->notification_callback = 'bp_favorite_format_notifications';//show the notification   
        $bp->active_components[$bp->bp_favorite->id] = $bp->bp_favorite->id;
    			
                do_action( 'bp_favorite_setup_globals' );
        }
                add_action( 'bp_setup_globals', 'bp_favorite_setup_globals' );
         
    
    function bp_favorite_format_notifications(  $action, $activity_id, $secondary_item_id, $total_items,$format='string'  ) { 
    $action_checker = explode('_', $action);
    $activities = bp_activity_get_specific( array( 'activity_ids' => $activity_id, 'display_comments' => true) );
    	$glue = '';
    	$user_names = array();
    
    	$users = find_favorite_involved_persons($activity_id, $action);
    	$total_user = $count = count($users);
    
    	if($count > 2) {
    		$users = array_slice($users, $count - 2);
    		$count = $count - 2;
    		$glue = ", ";
    	} else if($total_user == 2) {
    		$glue = " and ";
    	}
    
    	foreach((array)$users as $user_id) {
    		$user_names[] = bp_core_get_user_displayname($user_id);
    	}
    
    	if(!empty($user_names)) {
    		$favoriting_users = join($glue, $user_names);
    	}
    
    	switch ( $action ) {
    		case 'new_bp_favorite_'.$activity_id:
    			if($total_user > 2) {
    				$text = $favoriting_users.' and '.$count.' liked: '.substr($activities["activities"][0]->content,0,32).'...';
    			} else {
    				$text = $favoriting_users." like: ".substr($activities["activities"][0]->content,0,32)."...";
    			}
    		break;
    	}
    	$url = '<div id="'.$action.'"class="notification"><a href="#" class="social-delete" onclick="deleteAjaxNotification(\''.$action.'\',\''.$activity_id.'\', \''.admin_url( 'admin-ajax.php' ).'\'); return false;">x</a><span class="social-loader"></span></div>';
    	$link = favorite_activity_get_permalink( $activity_id );
    
    	if($format=='string') {
    		return apply_filters( 'bp_activity_multiple_favorite_notifications', '<a href="' . $link. '">' . $text . '</a>'. $url .'' ,$users, $total_user, $count, $glue, $link );
    	} else {
    		return array(
    			'link' => $link,
    			'text' => $text
    		);
    	}
    	return false;
    
    }
    function find_favorite_involved_persons($activity_id, $action) {
    	global $bp,$wpdb;
    	$table = $wpdb->prefix . 'bp_notifications';
    	return $wpdb->get_col($wpdb->prepare("select DISTINCT(secondary_item_id) from {$table} where item_id=%d and secondary_item_id!=%d and component_action = %s",$activity_id,$bp->loggedin_user->id, $action));
    }
    function favorite_activity_get_permalink( $activity_id, $activity_obj = false ) {
    	global $bp;
    
    	if ( !$activity_obj )
    		$activity_obj = new BP_Activity_Activity( $activity_id );
                        
    		if ( 'activity_comment' == $activity_obj->type )
    			$link = bp_get_activity_directory_permalink(). 'p/' . $activity_obj->item_id . '/';
    		else
    			$link = bp_get_activity_directory_permalink() . 'p/' . $activity_obj->id . '/';
    
    	return apply_filters( 'ac_notifier_activity_get_permalink', $link );
    
    }
    
    function favorite_notifier_remove_notification($activity ,$has_access){
           global $bp;
           if($has_access)		       
    	   bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->bp_favorite->id, 'new_bp_favorite_'.$activity->id );
    	}
    add_action("bp_activity_screen_single_activity_permalink","favorite_notifier_remove_notification", 10,2);
    
    function favorite_notification( $activity_id){  
                       global $bp;                 
    	               $activities = bp_activity_get_specific( array( 'activity_ids' => $activity_id, 'display_comments' => true) );
    				   $author_id = $activities['activities'][0]->user_id;
                       $user_id =  bp_loggedin_user_id();
    	// if favoriting own activity, dont send notification
    	if( $user_id == $author_id ) {
    		return false;
    	}
    				   if ( bp_is_active( 'notifications' ) ) {
    		bp_notifications_add_notification( array(
    			'user_id'           => $author_id,
    			'item_id'           => $activity_id,
    			'secondary_item_id' => $user_id,
    			'component_name'    => $bp->bp_favorite->id,
    			'component_action'  => 'new_bp_favorite_'.$activity_id,
    			'date_notified'     => bp_core_current_time(),
    			'is_new'            => 1,
    		) );
    	}				
    }
    add_action("bp_activity_add_user_favorite","favorite_notification", 10, 2);
    
    function deleteAjaxNotification(){
        global $bp;        
        bp_core_delete_notifications_by_item_id ($bp->loggedin_user->id, $bp->bp_favorite->id, 'new_bp_favorite_'.$activity->id);     
        die();        
    }	
    add_action('wp_ajax_deleteAjaxNotification', 'deleteAjaxNotification' ); 
    
    function bp_like_add_like_action() {
    global $bp, $activities_template; 
    	 if ( bp_activity_can_favorite() ) : 
    		
    				$my_fav_count = bp_activity_get_meta( bp_get_activity_comment_id(), 'favorite_count' );
    				
    				$my_fav_count = "<span>".$my_fav_count."</span>";
    				
    				$is_favorite = apply_filters( 'bp_get_activity_is_favorite', in_array( bp_get_activity_comment_id(), $activities_template->my_favs ) );
    		
    
    			 if ( !$is_favorite ) : ?>
    
    				<a href="<?php echo apply_filters( 'bp_get_activity_favorite_link', wp_nonce_url( home_url( bp_get_activity_root_slug() . '/favorite/' . bp_get_activity_comment_id() . '/' ), 'mark_favorite' ) ); ?>" class="tooltip-trigger fav bp-secondary-action bp-primary-action" title="<?php _e( 'Favorite', 'buddypress' ); ?>" style="position:relative;"><?php _e( 'Favorite', 'buddypress' ); ?><?php echo $my_fav_count; ?></a>
    
    			<?php else : ?>
    
    				<a href="<?php echo apply_filters( 'bp_get_activity_favorite_link', wp_nonce_url( home_url( bp_get_activity_root_slug() . '/favorite/' . bp_get_activity_comment_id() . '/' ), 'mark_favorite' ) ); ?>" class="tooltip-trigger unfav bp-secondary-action bp-primary-action" title="<?php _e( 'Remove Favorite', 'buddypress' ); ?>" style="position:relative;"><?php _e( 'Remove Favorite', 'buddypress' ); ?><?php echo $my_fav_count; ?></a>
    
    			<?php endif; 
    
    		 endif; 
    }
    add_filter( 'bp_activity_comment_options' , 'bp_like_add_like_action', 1000 );
    
    

    and java code

    function deleteAjaxNotification(action_id, activity_id, adminUrl){
        jQuery('#'+action_id).children(".social-delete").html("");
        jQuery('#'+action_id ).children(".social-loader").show(); 
    
        jQuery.ajax({
            type: 'post',
            url: adminUrl,
            data: { action: "deleteAjaxNotification", action_id:action_id, activity_id:activity_id },
            success:
            function(data) {
            	jQuery('#'+action_id).parent().hide();
            	
            }
         });  
    }
    #190874
    danbp
    Participant

    hi @canadadre,

    you have to read the mentionnedd topic AND to follow the links if the topic contains some. πŸ˜‰

    i hope for you that you know how to copy/paste, because the above snippets must be added to your child-theme functions.php, or better into bp-custom.php

    1. – Deny access to admins profile

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

    2. – Remove admin from the member directory and recount members

    
    // Remove admin from the member directory
    function bpdev_exclude_users($qs=false,$object=false){
        
        $excluded_user='1'; // Id's to remove, separated by comma
    	
        if($object != 'members' && $object != 'friends')// hide admin to members & friends 
        return $qs;
    	
        $args=wp_parse_args($qs);
    
        if(!empty($args['user_id']))
        return $qs;	
    	
        if(!empty($args['exclude']))
    		$args['exclude'] = $args['exclude'].','.$excluded_user;
        else
    		$args['exclude'] = $excluded_user;
    	
        $qs = build_query($args);
    
        return $qs;
    	
    }
    add_action('bp_ajax_querystring','bpdev_exclude_users',20,2);
    
    // once admin is removed, we must recount the members !
    function bpfr_hide_get_total_filter($count){
        return $count-1;
    }
    add_filter('bp_get_total_member_count','bpfr_hide_get_total_filter');

    3. – Hide admin’s activities from all activity feeds

    // 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 == 1  ) {			
    			
    			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 );

    May this help !

    #190864
    Andrea Reed
    Participant

    @danbp I look through your links but don’t see the answer to what I’m looking for. I basically want to hide the Administrator’s profile completely from the front end of the site.

    shanebp
    Moderator

    I wouldn’t rely on messing with visibility settings.
    To make a profile field only editable by admins, do this in bp-custom.php or a plugin:

    // only admins can edit the Skills field
    function chief_hide_profile_fields( $retval ) {
    	
    	if( is_super_admin () )
    		return $retval;
    
    	if(  bp_is_profile_edit() || bp_is_register_page() )
    		$retval['exclude_fields'] = '3';	//profile field ID's separated by comma
    
    	return $retval;
    
    }
    add_filter( 'bp_after_has_profile_parse_args', 'chief_hide_profile_fields' );

    Note that you need to add the correct id(s) for exclude_fields.
    And that ‘ || bp_is_register_page() ‘ keeps the field(s) off the register page – which you may not need to do.

    Re how to create profile fields in code, there a couple of ways to do it depending on the kind of field and how it will be used.
    Take a look at these plugins for more info:
    https://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/
    https://wordpress.org/plugins/buddypress-xprofile-image-field/

    #188599
    Jean-Pierre Michaud
    Participant

    i know some guys do not like codecanyon and the likes, but here is a guess on what you did not search yet:

    http://codecanyon.net/search?utf8=%E2%9C%93&category=wordpress&term=hide+admin

    #188563
    danbp
    Participant

    hi @canadadre,

    already asked and answered many times.
    https://buddypress.org/support/search/Hide+Admin/

    And the most recent answer with a partial solution is here:
    https://buddypress.org/support/topic/overwrite-whos-online-widget-theme/

    Partial means you have to complete the work, by using the same method, as the given example concern only one core widget, and not the 2 other (the 4th is the registration widget).

    #188504
    danbp
    Participant

    Another snippet, more accurate with the suggested way above. Snippet goes into bp-custom or functions.php

    The field/field group is only shown to site admins. A small bug in the current BP version(.0 -> 2.0.2) prevent of completely remove the group tab from the edit screen. Bug is fixed and this will work with BP 2.1.

    function bpfr_hide_profile_field_group( $retval ) {
    	if ( bp_is_active( 'xprofile' ) ) :	
    	
    	// hide profile group/field to all except admin	
    	if ( !is_super_admin() ) {		
    		//exlude fields, separated by comma
    		$retval['exclude_fields'] = '60';  
    		//exlude groups, separated by comma - this may work with BP 2.1
    		$retval['exclude_groups'] = '7'; 			
    	} 
    	return $retval;		
    	
    	endif;
    }
    add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_field_group' );
    #188500
    danbp
    Participant

    @csimpson,

    oh crossposting ! haven’t seen henry’s answer.

    nobody visibility doesn’t exist. This setting is called “only me“. This means that only the member can see this field – and the site admins. Such fields are not for site admins, but for the members !

    I don’t really understand what is not working for you, as what you’re looking for doesn’t exist in BuddyPress. Sorry if i’m misunderstanding you.

    When you create such a field visibility, you should also set “Enforce the default visibility for all members“, so the member cannot modify it later on his profile settings.

    Little weird side effect, when a “only me” field is used and member A wrote hello, this word becames clickabke, by default. When member B write also hello, it becames also clickable. And if A or B clcik on Hello, it shows a list of all members who wrote the same word. In this case A and B !

    Not really confidential, isn’t it ? The solution is to remove the clickable link.
    Here’s a snippet which let you do that selectively.

    function my_xprofile_filter_link_profile_data( $field_value, $field_type = 'textbox' ) {
        // Access the field you are going to display value.
        global $field;
    	
        // In this array you write the ids of the fields you want to hide the link.
        $excluded_field_ids = array(2,9,54); // field ID separated by comma
    	
        // If the id of this $field is in the array, we return the value only and not the link.
        if (in_array($field->id, $excluded_field_ids))
    	return $field_value;
    
    	if ( 'datebox' == $field_type )
    	return $field_value;
    	
    	if ( !strpos( $field_value, ',' ) && ( count( explode( ' ', $field_value ) ) > 5 ) )
    	return $field_value;
    	
    	$values = explode( ',', $field_value );
    
    	if ( !empty( $values ) ) {
    		foreach ( (array) $values as $value ) {
    			$value = trim( $value );
    			
    			// If the value is a URL, skip it and just make it clickable.
    			if ( preg_match( '@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', $value ) ) {
    				$new_values[] = make_clickable( $value );
    				
    				// Is not clickable
    			} else {
    				
    				// More than 5 spaces
    				if ( count( explode( ' ', $value ) ) > 5 ) {
    					$new_values[] = $value;
    					
    					// Less than 5 spaces
    				} else {
    					$search_url   = add_query_arg( array( 's' => urlencode( $value ) ), bp_get_members_directory_permalink() );
    					$new_values[] = '<a href="' . $search_url . '" rel="nofollow">' . $value . '</a>';
    				}
    			}
    		}
    		
    		$values = implode( ', ', $new_values );
    	}
    	
    	return $values;
    }
    
    /**
     * We remove the buddypress filter and add our custom filter.
     */
    function remove_xprofile_links() {
        // Remove the old filter.
        remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 );
        // Add your custom filter.
        add_filter( 'bp_get_the_profile_field_value', 'my_xprofile_filter_link_profile_data', 9, 2);
    }
    add_action('bp_setup_globals', 'remove_xprofile_links');
    #188499
    Henry Wright
    Moderator

    I think the field visibility settings are applicable to the member who is performing the setting.

    The suggested way to do what you want would be to make your notes profile field hidden to all non-admin members.

    The first step would be to create /wp-content/themes/your-theme/buddypress/members/single/profile/edit.php inside your theme.

    You can copy the contents of edit.php from:

    bp-templates/bp-legacy/buddypress/members/single/profile/edit.php

    Then you need to modify edit.php. In edit.php, find <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?> and add the following immediately after it:

    if ( ! current_user_can( 'manage_options' ) && ( bp_get_the_profile_field_name() === 'notes' ) )
        continue;

    Note: I’m assuming your field name is notes

    #185851
    pstidsen
    Participant

    Hi danbp

    I have now inserted all of your code in functinos.php, but the only place the admin user disappear is at the “All users”-page. The admin user still shows up at the group members pages and the front page where I have listed all members with the Bowe code plugin.

    I need to hide the admin from the entire site.

    #185618
    danbp
    Participant

    @ganzuelo

    scrolling down the member page provides a funny elastic effect ! πŸ˜‰ Really cool, but not what you want of course.
    I disabled js on the browser and the effect disapeared immediatly.
    So i think there is a js conflict, probably with some of your theme’s script.
    check for the elements
    `<div class=”col span_3>
    <a>
    <img alt=”Foxtrot Tango” /> `

    You mention salient to be your theme but the source code indicates castle ? Did you rename it for a child theme usage ?
    Some script don’t support this…

    You use also a plugin to remove the admin bar.

    <!--Plugin Global Hide Admin Tool Bar 1.6.1 Build 2014-04-16 Active --->
    <!-- This website is patched against a big problem not solved from WordPress 3.3+ to date -->

    Huh ?

    Don’t know if the second comment belongs to that plugin, but if yes, WP is currently in 4.0 phase, so a 3.3 “problem” maybe solved.
    Google to find a simplier solution to remove the toolbar. There is also a easy and light solution in on the WP codex.

    add_filter('show_admin_bar', '__return_false'); in theme’s function or bp-custom.php would do the job on front-end !

    Don’t use a hammer to kill a fly ! πŸ˜‰

    #185464
    jejemo
    Participant

    Thanks for you help !

    Actually I hide the admin bar on my pages. That’s the reason why I’m trying to build the exact same menu on another navigation bar.

    I feel like it is a bug because here, it says that :

    $bp->bp_nav “is the array used to render each component navigation menu item for the logged in user”

    and

    $bp->bp_options_nav “is the array used to render all of the sub navigation items for the $bp->bp_nav array”.

    Actually I feel like I’m having the result of $bp->bp_users_nav.
    Because it “is the array used to render each component navigation menu item for the displayed user (when you view a user that is not you).”

    What do you guys think ?

    @mercime
    Participant

    or have I somehow done something to hide it from non-admins?


    @fakename014
    Either via some function in your custom theme or a plugin. To confirm which, change to the Twenty Fourteen theme and check if the adminbar shows up. If it still isn’t showing up, deactivate all plugins to check which one is causing the issue.

    #184252
    nirgalo
    Participant

    Hi, I wanted to also hide admin from the “last activity” widget. I did an override of bp-core/bp-core-widget.php in my theme but it was not taken into account. However if I directly modify bp-core-widget.php in the BP plugin directory, then in works. Too bad the override doesn’t work, I guess I need to create my own widget…

    #184166
    nirgalo
    Participant

    Thanks mercime. However what I’d like is to hide the admin from the Members page only but not disable its activity, as sometimes it needs to post a few notes.

    #184164
    @mercime
    Participant
    #183895
    Netz
    Participant

    Hi!
    Ehhh any functions.php ?? Themes, BP or in a specific folder?

    Running WP 3.9.1 and BP 2.0.1

    I also want to remove “HOME” in BP
    So the result should be first MENU Item is “FORUM” then “MEMBERS” “SEND INVITATIONS” and “ADMIN” (for admins only)

    As default the menu is :
    “HOME” then “FORUM” then “MEMBERS” “SEND INVITATIONS” and “ADMIN” (for admins only)

    But users that get’s in at the “HOME” level post messages thinking they are posting in the FORUM…? So that is why I want to hide it or take it off!

    Hope this solution works – But are unsure where to stick it… πŸ™‚

    Best regards

    Nets

    #183799
    dromy
    Participant

    Did you succeeded?

    I would like to hide the admin option panel (profile and view) when the user is not the owner of the profile.

    can you advice?

    #183554
    asianowl
    Participant

    after a shower — it came to me that I should just hide the menu item in CSS with the following:
    #wp-admin-bar-my-account-activity{display:none;}

    But this hides it from everyone… does anyone else have a better idea?

    Iurie Malai
    Participant

    @danbp, I know how to check for errors, but this didn’t helped me too much :). I solved with the blank page, but no more. Your solution works for hiding some xProfile tabs from viewing, but not from editing them. Am I wrong? Sorry!

    This is my tested function (as I said, it hiding only from viewing, not from editing):

    
    function flegmatiq_profiles( $retval ) {
    
       if ( is_user_logged_in() && !bp_is_profile_edit() ) {
          $myfield = xprofile_get_field_data( 'User Type' );
          if( $myfield == "Faculty" ) {
             $retval['exclude_groups'] = '2';
    	 //$retval['exclude_fields'] = '6,18,39';
          }
       }
    
       return $retval;
    
    }
    
    add_filter( 'bp_after_has_profile_parse_args', 'flegmatiq_profiles' );
    

    The next code works as I need, but I think it is not so elegant, and it not allow to use the group ID, only his order number, as ordered by admin:

    
    function hide_profile_group_tabs_from_editing( $group_names ){
    
       if ( is_user_logged_in() && bp_is_profile_edit() && xprofile_get_field_data( "User Type") != "Faculty" ) {
          for ($x=0; $x<=sizeof($group_names); $x++) {
             if ( $x != 3 ) echo $group_names[$x]; //3 is the order number (from 0) of the tab that I need to hide in the profile edit page. This is not the group ID.
          }
       } else {
          return $group_names;
       }
    
    }
    
    add_filter('xprofile_filter_profile_group_tabs', 'hide_profile_group_tabs_from_editing');
    
    #183332
    amckinnell
    Participant

    Hi Henry, here is the contents of that window:

    Request URL: http://photoforte.com/wp-admin/admin-ajax.php
    Request Method: POST
    Status Code: HTTP/1.1 200 OK
    Request Headers 12:51:58.000
    X-Requested-With: XMLHttpRequest
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:29.0) Gecko/20100101 Firefox/29.0
    Referer: http://photoforte.com/activity/
    Pragma: no-cache
    Host: photoforte.com
    Content-Type: application/x-www-form-urlencoded; charset=UTF-8
    Content-Length: 97
    Connection: keep-alive
    Cache-Control: no-cache
    Accept-Language: en-gb,en;q=0.5
    Accept-Encoding: gzip, deflate
    Accept: application/json, text/javascript, */*; q=0.01
    Sent Cookie
    wp-settings-time-10: 1398959694
    wp-settings-10: libraryContent=browse&editor=html&wplink=1&urlbutton=none&imgsize=full&align=center&hidetb=1
    wordpress_test_cookie: WP+Cookie+check
    wordpress_logged_in_0226a87af55d37f15c17099beebb5b87: amckinnell|1402256837|5ccb9ec3cbdec1dc82a94b7ed790dd41
    wordpress_0226a87af55d37f15c17099beebb5b87: amckinnell|1402256837|5b043d1b070ce3f02b6457a112bdfd6a
    s2member_tracking: fnIyOk5PVFdEQUJGSk9CeFBsZ2NMV3BiN2Rna3hMQUw0aTZzOmI3ZmEwNjU4NTQ2MGE0OWNiZDlmYTJhZGE2OTIyNDQzfEKGYUXbL9qRK4qkpq9Olm8qeZTiTkNtW3IJQea7fc4a
    PHPSESSID: d3jd0dp456hmi7p57ib09rrku7
    bp-activity-oldestpage: 1
    __utmz: 82912087.1400555092.174.6.utmcsr=Photo Forté Members|utmccn=7ce74da5f7-2014_May_Lesson_Week_3|utmcmd=email|utmctr=0_76b17b8542-7ce74da5f7-
    __utmc: 82912087
    __utmb: 82912087.7.9.1401047433231
    __utma: 82912087.1423870743.1397575542.1400993272.1401047233.201
    Response Headers Ξ”1626ms
    X-Robots-Tag: noindex
    x-frame-options: SAMEORIGIN
    x-content-type-options: nosniff
    Transfer-Encoding: chunked
    Server: Apache
    Pragma: no-cache
    Keep-Alive: timeout=5, max=85
    Host-Header: 192fc2e7e50945beb8231a492d6a8024
    Expires: Wed, 11 Jan 1984 05:00:00 GMT
    Date: Sun, 25 May 2014 19:51:50 GMT
    Content-Type: text/html; charset=UTF-8
    Connection: Keep-Alive
    Cache-Control: no-cache, must-revalidate, max-age=0

    About your other questions, it is a total custom theme, but I haven’t made any changes to it for weeks and this problem just cropped up a couple of days ago. I know for sure it just started because I use that load more all day.

    It’s difficult for me to answer the question about whether it happens in the default theme because I don’t want to change my live site because people are using it, and when I create a staging site, the load more button works in the current theme. I cannot understand why the problem only exists on the live site and not the staging site. I am creating the staging site when I am seeing the issue, it only takes a couple of minutes to create it, it’s on the same server, but the load more button works there.

    Thanks again for your help.

    #181494
    godavid33
    Participant

    *sigh*

    Of course, as soon as I post this, I find the problem.

    
    function my_hidden_activities($a, $activities) {
    	//if admin we want to know
    	//if (is_site_admin())
    		//return $activities;
    
    	$nothanks = array('activity_comment');
    
    	foreach ($activities->activities as $key => $activity) {
    		if (in_array($activity->type, $nothanks, true)) {
    			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', 'my_hidden_activities', 1, 2 );
    

    The above code causes this problem. The code is attempting to hide comments from appearing as their own activity stream items. Any suggestions on how I can hide comments from appear anywhere except for in the thread they are nested in?

    #181319
    godavid33
    Participant

    Solution: credit to @lincme on the post https://buddypress.org/support/topic/filtering-out-activity-stream-stuff/

    
    // Remove (hide) various activities from streams.
    function my_hidden_activities($a, $activities) {
    	//if admin we want to know
    	//if (is_site_admin())
    		//return $activities;
    
    	$nothanks = array('activity_comment');
    
    	foreach ($activities->activities as $key => $activity) {
    		if (in_array($activity->type, $nothanks, true)) {
    			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', 'my_hidden_activities', 10, 2 );
    
    #180394

    In reply to: Disable admin bar

    Splendorito
    Participant

    I did find a plugin now that correct this easy.
    Global admin bar hide or remove

    Thank you anyway

    Best Regards

Viewing 25 results - 251 through 275 (of 634 total)
Skip to toolbar