BuddyDev

Search

[Resolved] Using BuddyPress Member Types as profile field Visibility Levels

  • Participant
    Level: Enlightened
    Posts: 134
    HansRuedi Keller on #26039

    Hi Brajesh,

    I would like to use the code you provide in this blog post…
    https://buddydev.com/using-buddypress-member-types-as-profile-field-visibility-levels/

    I’ve installed…
    BuddyPress 4.4.0 and
    BuddyPress Member Types Pro 1.3.8
    …and registered only 1 additional Member Type called “Coworker”.

    I’ve tried to use your code in functions.php or bp-custom.php but neither is working in the backend for xProfile fields visibility settings.

    I can’t see that additional Member Type “Coworker” in the popups for visibility.

    Thanks for help, Hans

  • Keymaster
    (BuddyDev Team)
    Posts: 24257
    Brajesh Singh on #26040

    Hi Hans,
    Did you copy both part of the tutorial?

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 134
    HansRuedi Keller on #26043

    Hi Brajesh,
    Thanks for your reply. Yes, I was following Step 1 and Step2 of your tutorial…

    …sorry, just found the link in your post. I will let you know later today.

    Regards,
    Hans

  • Participant
    Level: Enlightened
    Posts: 134
    HansRuedi Keller on #26045

    Hi Brajesh,
    ok, I downloaded your sample plugin…
    https://github.com/buddydev/extended-xprofile-field-visibility-levels

    That’s working (got new visibility level called «My Group Members» in backend)…

    …after that I activated code from step 1 her…
    https://buddydev.com/using-buddypress-member-types-as-profile-field-visibility-levels/
    …and then step 2 ending up here:

    Fatal error: Cannot redeclare buddydev_get_hidden_visibility_types_for_user() (previously declared in /home/www-data/<domain>/wp-content/plugins/extended-xprofile-field-visibility-levels/extended-xprofile-field-visibility.php:71) in /home/www-data/<domain>/wp-content/plugins/code-snippets/php/snippet-ops.php(361) : eval()’d code on line 32

    Thanks for help,
    Hans

  • Keymaster
    (BuddyDev Team)
    Posts: 24257
    Brajesh Singh on #26049

    Hi Hans,
    both have same function names. That’s why you are getting fatal error.

    You can not use them together.

    You will need to adapt the code from the tutorial to the plugin.

    regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 134
    HansRuedi Keller on #26063

    Did it, thank you Brajesh!

  • Keymaster
    (BuddyDev Team)
    Posts: 24257
    Brajesh Singh on #26075

    You are welcome.

The topic ‘ [Resolved] Using BuddyPress Member Types as profile field Visibility Levels’ is closed to new replies.

This topic is: resolved