Skip to content

Instantly share code, notes, and snippets.

@wp-user-manager
Last active July 18, 2024 20:46
Show Gist options
  • Save wp-user-manager/ff7d6c58906fba97b983a013b90cb5aa to your computer and use it in GitHub Desktop.
Save wp-user-manager/ff7d6c58906fba97b983a013b90cb5aa to your computer and use it in GitHub Desktop.
WP User Manager - Content Restriction function to restrict parts of a templat
<?php
get_header();
if ( wpum_can_access_restricted_content() ) : ?>
Some extra content in the template that is restricted as per the restriction settings of the page
<?php endif; ?>
<div>
<?php the_content(); ?>
</div>
<?php get_footer(); ?>
@ryanhilton
Copy link

@wp-user-manager how can I use this function to show the content based on a user role?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment