BuddyDev

Search

[Resolved] BuddyPress Xprofile Member Type Field issue

  • Participant
    Level: Initiated
    Posts: 3
    Lapo on #9313

    Hi to all,
    i cant understand why this plugin let me to register the member type via registration form, but then when im trying to quering member type in my bp-custom file i receive just empty value!
    And before, some months ago, works perfectly!

    for example:
    var_dump(bp_get_member_type(bp_displayed_user_id()));—> bool false
    var_dump(bp_get_member_type(get_current_user_id()));—> bool false
    var_dump(bp_get_member_type());—> bool false
    var_dump(bp_get_member_type(bp_displayed_user_id(),true));—> bool false
    var_dump(bp_get_member_type(get_current_user_id(),true));—> bool false
    var_dump(bp_get_member_types());—> empty array

    But the xprofile member type field have the correct value registred by mine bp-costum as suggested in bp codex section:
    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’ );

    What i suspect is that the plugin do not save the right value on the right field… how can i trouble shooting this?
    thank a lot

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #9314

    Hi Lapo,
    i just tested the plugin. It is working fine for the new registrations.
    Are you sure that user registered through your normal registration process?

    Please try registering a new user and checking their profile after activation.

    I used your code and it is giving me correct result.

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 3
    Lapo on #9319

    I spot the problem few second ago! it was not a plugin issue, but mine fault! but before it works!

    this is the fault code:
    add_action( ‘bp_init’, ‘using_mt_register_member_types’ );

    should set to
    add_action( ‘bp_register_member_types’, ‘using_mt_register_member_types’ );

    so bp_init make the mess!
    thanks for your quick reply!

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #9342

    Thank you. It’s good to know 🙂

The topic ‘ [Resolved] BuddyPress Xprofile Member Type Field issue’ is closed to new replies.

This topic is: resolved