Viewing 1 replies (of 1 total)
  • Plugin Author Damian

    (@timersys)

    Hi @teeboy4real,
    we added the mosts common template tags for Buddypress, there are tons. The good news is that you can easily add as many as you need like this:

    In your theme’s functions.php add

    // add new rule to options
    add_filter( 'wppopups_bp_rules_options', function($rules) {
       $rules['bp_member_type'] = 'Member Type;
    
       return $rules;
    });
    
    // set new option to accept values
    add_filter( ''wppopups/rules/field_type', function( $type, $rule ) {
       if( $rule == 'bp_member_type' ) {
           $type = 'text';
       }
       return $type;
    }, 2);
    
    // Check rules for member type
    add_filter( 'wppopups_rules_rule_match_bp_member_type', function( $rule ) {
        $user_id = get_current_user_id();
        $type = bp_get_member_type( $user_id );
         if ( $rule['operator'] == "==" ) {
    	return in_array( $rule['value'], $type );
         }
         return ! in_array( $rule['value'], $type );
    });
Viewing 1 replies (of 1 total)
  • The topic ‘Buddypress member type support’ is closed to new replies.