Forum Replies Created
-
AuthorPosts
-
February 20, 2016 at 2:18 pm in reply to: Hide hidden/locked pages from custom theme category page #24901Joseph JordanParticipantThis reply has been marked as private.February 20, 2016 at 2:16 pm in reply to: Hide hidden/locked pages from custom theme category page #24900Joseph JordanParticipant
Hello Syam,
We would specifically want to take the current check:
if(current_user_can('editor')) { }
and make it something like “if current user has permission by how the permissions were selected in the article, then they can see the post”.
something like (if(current_user_can(‘read’)). But this meaning that the current user can only see those posts and article titles and article excerpts that were given permission.
Thank you,
February 19, 2016 at 4:11 am in reply to: Hide hidden/locked pages from custom theme category page #24814Joseph JordanParticipantFinal followup question – if it’s not a good idea to add this tag into the template, is there a way I can add this custom post type to the roles plugin so it will correctly block the title?
February 19, 2016 at 3:05 am in reply to: Hide hidden/locked pages from custom theme category page #24781Joseph JordanParticipantI was wrong – I just noticed that “current_user_can” is a function of WordPress, not of User Role Editor.
Hopefully that will explain what I need though –
Basically I need a check of “IF “current user can” -> “view posts as defined by the role permission of each post” THEN “View hkb-content-article” ELSE “hide the post”.
February 19, 2016 at 2:16 am in reply to: Hide hidden/locked pages from custom theme category page #24777Joseph JordanParticipantI may be close to a solution…
When wrapping the incorrectly displaying locked pages with:
<?php if (current_user_can('edit_nav_menu_permissions')) : ?> <?php hkb_get_template_part('hkb-content-article'); ?> <?php the_excerpt(); ?> <?php else :?> Denied. <?php endif; ?>
The menu shows “Denied” if the user cannot edit nav menu permissions. Obviously we don’t want to deny on this, but we want to deny on whether or not that user’s role is denied within the post.
Am I on the right track? If so, what should I be using instead of “Edit nav menu permissions”?
Thank you!
February 18, 2016 at 12:01 am in reply to: Hide hidden/locked pages from custom theme category page #24704Joseph JordanParticipantThis reply has been marked as private.February 16, 2016 at 9:14 pm in reply to: Hide hidden/locked pages from custom theme category page #24596Joseph JordanParticipantThis reply has been marked as private.February 16, 2016 at 2:51 am in reply to: Hide hidden/locked pages from custom theme category page #24550Joseph JordanParticipantApologies for the spelling errors above!
Just to elaborate- we don’t have a paid/public role structure, otherwise something like:
< ?php echo do_shortcode('[paid_read_more]Read More[/paid_read_more]'); ?>
would work.We have a membership role for each dept. Example: HR dept can view HR pages. IT dept can view IT pages, etc. So it will literally need to check if the “title” as our template stores them is a visible post type based on that user’s permissions.
Any idea on how to accomplish this? Thank you!
-
AuthorPosts