Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 1 replies (of 1 total)

  • haughtam
    Participant

    @haughtam

    It’s been a while since my original post, but I think I’ve figured this out and I hope this helps someone else.  The original problem changed a bit too.  Basically, now I want to show a profile group based on the value in an xprofile field (when editing a profile).  So, if my User Category field for a logged in user says Recruiter, then I want to show the profile group called “Recruiter” (show this for admins too).  Otherwise, I want to hide this profile group through php.

    Thanks to the hint above, I was able to come up with a function in my child theme’s function.php file.

    I’m just learning php/wordpress, and I don’t have a clear understanding why this works.  I do know that $group_name[3] is the Recruiter profile group.  Also, I do realize this snippet uses awful coding practices.  If anyone has improvements, please let me know.

    function my_recruit($group_name){

    if ( is_site_admin() || xprofile_get_field_data( “User Category”)===”Recruiter”) {

    echo $group_name[0];

    echo $group_name[1];

    echo $group_name[2];

    echo $group_name[3];

    }

    else {

    echo $group_name[0];

    echo $group_name[1];

    echo $group_name[2];

    }

    }

    add_filter(‘xprofile_filter_profile_group_tabs’,’my_recruit’);

Viewing 1 replies (of 1 total)
Skip to toolbar