This topic has 3 replies, 2 voices, and was last updated 11 years by SQadmin.

  • Author
  • #5973
     JohnDoe
    Participant

    How would we add , if u wanna add someone , you need a certain pmpro ID

    #6076
     SQadmin
    Keymaster

    Hi there,
    This is the code that has to be added to sweetdate-child/functions.php. Make sure to have the child theme activated:

    COPY CODE
    
    /* Remove the Add friend button for users that don't have certain membership levels */
    add_action('after_setup_theme', 'restrict_friend_button');
    function restrict_friend_button()
    {
    	$membership_levels = array(2,3);
    	if (!pmpro_hasMembershipLevel($membership_levels) ) {
    		remove_action( 'bp_member_header_actions', 'bp_add_friend_button', 5 );
    		remove_action('bp_directory_members_item_last','kleo_bp_member_dir_friend_button', 11);
    	}
    }
    

    Replace your level ids with the 2,3 from this example

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #6090
     JohnDoe
    Participant

    This code says , that u need ID 2 or 3 to add someone right?

    #6107
     SQadmin
    Keymaster

    Yep 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?