Reply To: get member type broken
thanks a lot but this was already tested with no result!
or better, same result! same id! on the context! i try to give a full vision of my site conf:
on bp-custom on buddypress folder ive this:
function using_mt_register_member_types() {
bp_register_member_type( 'Problem solver', array(
'labels' => array(
'name' => 'Problem solvers',
'singular_name' => 'Problem solver',
),
) );
bp_register_member_type( 'Entrepreneur/policy maker', array(
'labels' => array(
'name' => 'Entrepreneur/policy makers',
'singular_name' => 'Entrepreneur/policy maker',
),
) );
}
add_action( 'bp_init', 'using_mt_register_member_types' );
then in my plugins ive active “Member Type Field for Buddypress XProfile”
and in mine xprofile field ive one setted to select the user type during registration by users. it show my option described above!
then on the same bp_custom file for building a “conditional menu” ive this snippet of code:
function add_break_in_tabs() {
if ( !function_exists( 'bp_get_member_type' ) ) {
require_once ABSPATH . PLUGINDIR . 'buddypress/bp-members/bp-members-functions.php';
}
$user_id=bp_displayed_user_id();
$user_id2=get_current_user_id();
$tipo=bp_get_member_type();
echo $user_id.$user_id2;---->SAME RESULT SHOWED!
echo $tipo;--->NOTHING TO SHOW
var_dump($tipo);---> BOOOL FALSE
....
On the user’s list i can set type for each user.
On registration i can see and select the type.
On Xfield definition ive no option to select but the option showed in the registration form are correct!
thanks a again to any contributor