Skip to main content

PHP code for member of space?

Would anyone know how to add a line of code into a snippet the logically does this...

if(member of a space) then {}

Thomas Oates

Something like might work assuming you know the space ID.

if (\FluentCommunity\App\Services\Helper::isUserInSpace(get_current_user_id(), $spaceID)) {
    //do something
}

Hush Work

Would be much easier if your member(s) are also in CRM with tags. Would also give you alot more granular options for this issue AND going forward should you need.
So, in your build, are your community members also in CRM AND using tags for them?

Paul Hopkins

Hush WorkΒ yes I’ve got granular control with fluentCRM and WP Fusion. Tags galore! The problem comes when you want a post visible to the public, no registration needed, so no fluentCRM tags have been applied yet, but then also you want to make it invisible to those who have joined and have tags. I’ve found a way though with PHP. Works a treat.