Are you logged into the plugin site? When I log in with you account, the member forums are readable.
Regarding your template check, do you need to know if the post is restricted from the current user, or for any users?
Thread Starter
Lampre
(@lampre)
Hi Kevin,
Just for the current user.
In the template post or page, if we don’t have any restriction, i want to display specific shortcode.
If we have one or more restrictions, i dont want to display my speficic shortcode.
I will test for access to the forum
I’m still not sure what you have in mind by “one or more restrictions” for the current user on the current post. Would this be, for example, a Reading Exception on the post which would normally prevent the user from accessing it at all? You instead want it to leave the page readable but affect the behavior of your shortcode? Or is the user unrestricted for reading but you want to limit the shortcode display if they have an editing exception on the page? I need a specific case to answer.
Thread Starter
Lampre
(@lampre)
Hello Kevin,
I think its very simple for you ๐
Configuration, 15 users at this time, 15 groups (1 user in each group)
1 post for each group > donโt want shortcode
5 posts for all groups > donโt want shortcode
5 posts for everyone.. in this world > we want the shortcode
I think we must add fucntion, in the template post file, for check if we have resctriction or not …
I still don’t understand the shortcode display logic you are looking for, but will take another stab at it. Are you saying that if the page has any exceptions set for any user or group, you want the current user to see the shortcode?
Thread Starter
Lampre
(@lampre)
If the page/post has one or more exceptions for at least one user or group, the current user can’t see the shortocde.
My shortcode is sharing bar (google+, linkedIn,Facebook)
if my page can not be read by everyone, share links have no interest , and so I do not want to display it
Thanks Kevin
global $post;
$arr = ppc_get_exceptions( array( 'operations' => 'read', 'for_item_source' => 'post', 'item_id' => $post->ID, 'assign_for' => 'item', 'return_raw_results' => true ) );
if ( ! empty( $arr ) ) {
// show stuff
}
Note that this only covers reading exceptions assigned directly to the page. To check for exceptions assigned to post terms, you would need to retrieve those terms and then make additional ppc_get_exceptions() calls with via_item_source = ‘term’ and ‘item_id’ = $term->term_taxonomy_id
Thread Starter
Lampre
(@lampre)
Thanks !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ๐