Cannot add ccap with tag.
-
Hi, I tried searching everywhere for weeks now and couldn’t get ideal answer via pre-purchase support.
I am running a security company and want my employees to post to a blog page via email. They will be using contact form plugin combined with Postie plugin. No backend is allowed for them. I need to add ccaps to every post as if it was entered manually in restriction meta box.
I used this code in /mu-plugins/ that I found on your old forums:
add_action ("wp", "my_custom_capabilities"); function my_custom_capabilities () { if(has_tag("client_a") && !current_user_can ("access_s2member_ccap_client_a")) { header ("Location: ".S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL); exit(); } }
It indeed redirected me when I clicked on protected post when logged in with the account that does not have the required ccaps. The problem here is that it does not protect the title of the post and its excerpt from the blog page.
When I enter ccaps manually via restrictions metabox from backend, it just hides the post entirely for all users without ccap “client_a”
This is critical for my business model because I do not want client B to see security guard submitted activity logs(posts) for client A, client C, client D, etc. I want them to feel like that feed is exclusively theirs and see titles of posts with client_a tags /ccaps.
Thank you in advance and let me know if anything from what I asked is not clear.
- The topic ‘Cannot add ccap with tag.’ is closed to new replies.