• Resolved andrijafzv

    (@andrijafzv)


    Hello,
    I should have the following functionality on the site: the site consists of a customer site and another microsite located on the same domain. I want to restrict customer site users from seeing microsite content and vice versa. I tried using filters, but it didn’t work.
    in functions.php:
    apply_filters( 'wf_collection_policy_can_view', $allowed, $folder_id, $user_id, $this )

    apply_filters( 'wf_collection_policy_can_view', false, (i got folder id when inspecting element data-folder-id), (should I get id with this function "get_current_user_id()"?), What should I pass on here? )

Viewing 1 replies (of 1 total)
  • Plugin Author wickedplugins

    (@wickedplugins)

    Hi @andrijafzv,

    data-folder-id is the correct way to get the folder ID. The permission filters should return true if you want the user to have the permission for the specified folder ID or false if not. Note that the permissions only apply to folders; they don’t apply to content within the folders. So wf_collection_policy_can_view controls whether or not the user can view the folder with the specified folder ID.

    In order to filter the content within a folder, you’d likely need to use the pre_get_posts action to filter out the content you want to hide.

    I hope this helps. Let me know if you still have questions.

    FYI, since this is a question/issue about a feature in the pro version that doesn’t apply to the free version here on WordPres, I’m going to mark this as resolved. If you still have trouble, feel free to respond to the email I sent you. Thanks.

Viewing 1 replies (of 1 total)
  • The topic ‘Restrict the specified user from being able to see the folder and its contents’ is closed to new replies.