Shape the future of Social networking with WordPress: Join Project Midnight Sun! The next generation platform for community building with WordPress!

BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25304

    Hi Fabian,
    I am sorry for the delaye.

    Please use the following code and you can specify the field ids to be excluded.

    
    
    /**
     * Filter display of BP Profile search form fields by role.
     */
    function buddydev_enable_conditional_profile_search_form_fields( $form ) {
    
    	if ( ! is_user_logged_in() ) {
    		return $form;// update as you need. we are not restricting.
    	}
    
    	// Use comma separated field ids to exclude for the given role.
    	$roles_excluded_fields = array(
    		'subscriber'    => array(1,3),
    		'contributor'   => array(),
    		'author'        => array(),
    		'editor'        => array(),
    		'administrator' => array( ),
    	);
    
    	// I am assuming that user has only one role.
    	$role            = current( wp_get_current_user()->roles );
    	$excluded_fields = isset( $roles_excluded_fields[ $role ] ) ? $roles_excluded_fields[ $role ] : array();
    
    	if ( empty( $excluded_fields ) ) {
    		return $form;
    	}
    
    	for ( $i = 0; $i < count( $form->fields ); $i ++ ) {
    		if ( empty( $form->fields[ $i ] ) || empty( $form->fields[ $i ]->id ) ) {
    			continue;
    		}
    		if ( in_array( $form->fields[ $i ]->id, $excluded_fields ) ) {
    			unset( $form->fields[ $i ] );
    		}
    	}
    }
    add_action( 'bps_before_search_form', 'buddydev_enable_conditional_profile_search_form_fields' );
    add_action( 'bps_before_filters', 'buddydev_enable_conditional_profile_search_form_fields' );
    
    

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25304
    Brajesh Singh on in reply to: [Resolved] Remove activity filter option #45555

    Hi Tosin,
    Thank you for the confirmation.

    I am sorry, I am not familiar with that plugin.
    You may want to approach the author for help.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25304
    Brajesh Singh on in reply to: Issues with registration member types. #45551

    Hi Ethan,
    Please check my reply about adding a tab via BP Custom Profile Menu. You can not remove a tab added by that plugin conditionally. That will cause 404. I have shared this detail in my previous reply.

    You may use our Profile Tabs Creator pro to achieve this conditional from the settings. Please do note that if you applied conditional tab via code even to the tabs created by Profile Tabs pro, it will also be 404.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25304
    Brajesh Singh on in reply to: Issues with registration member types. #45543

    Hi Ethan,
    Please check the site. I have temporarily disabled the “Notifications” menu only for the “Administrator role”.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25304

    Hi Nik,
    Thank you for the question.

    1. If the content is being shown for event manager, then it seems their screen callback might not have been removed correctly or there is some bug in how the event manager renders the content.

    The simple solution will be to use a different slug or you can debug further if you want to keep the same slug.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25304
    Brajesh Singh on in reply to: [Resolved] Remove activity filter option #45540

    Hi Tosin,
    Please put this in your bp-custom.php

    
    /**
     * Removes the Updates & new members fro activity options dropdown.
     */
    add_filter( 'bp_get_activity_show_filters_options', function ( $filters ) {
    
    	unset( $filters['activity_update'] );
    	unset( $filters['new_member'] );
    
    	return $filters;
    } );
    
    

    Let me know if it works or not?

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25304
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25304
    Brajesh Singh on in reply to: Issues with registration member types. #45536

    Hi Ethan,
    I hope you are doing well.

    I am sorry but I haven’t been able to assist you properly due to two different issues being discussed in a single topic.

    If you can provide me again with the list of specific issues that you want me to look into, I can try it quickly today. Otherwise, I am happy to offer the refund.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25304
    Brajesh Singh on in reply to: BuddyPress Moderation Tools #45535

    Hi John,
    I am sorry for the delayed reply.

    Please use the current version of MediaPress from here.
    https://github.com/buddydev/mediapress

    It seems to be working with the Gwangi theme.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25304

    Hi Fabien,
    Thank you.

    Please allow me to check the BP Profile Search plugin and get back to oyu in next 24 hours with a solution(hopefully).

    Regards
    Brajesh