Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hiding activities and selector if no member of the public group


  • HDcms
    Participant

    @hdcms

    Hello,

    The ultimate goal is to mask the content and selector when a member arrives on the page of a public group to which it has not acceded. In fact he will see just the top of the page, and description button to join group

    screenshot:
    https://framapic.org/j4FYWFvZmHVI/sOyIzEz0Gl7F.png

    The idea is to reach over activities and other menu group visited oblige to register if he sees that description, avatar and the button to join

    I found bp_group_is_member to test ()
    http://buddypress.wp-a2z.org/oik_api/bp_group_is_member/
    If I do not put any argument, I understand that it will test whether the member is party group (and I add the condition to be displayed in a group?

    I have an error message:
    « Fatal error: Call to undefined function bp_group_is_member() in /var/www/../wp-content/plugins/bp-custom.php on line 3 »

    What I found to achieve the goal:

    if ( !bp_group_is_member() || bp_is_active('groups') )
     {add_filter( 'bp_after_has_activities_parse_args', 'my_bp_activity_types_non-membre' );}
     
    function my_bp_activity_types_non-membre( $retval ) {
        $retval['action'] = array(        
            //'activity_comment',
    	//'activity_update',
    	//'created_group',
    	//'friendship_created', nouv relation entre membre
    	//'joined_group',
    	//'last_activity',
    	//'new_avatar',
    	//'new_blog_comment',
            //'new_blog_post',
    	//'new_member',
    	//'updated_profile',
    	//'rtmedia_update'       
        ); 
        return $retval;

    Regards

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar