/** * Here is a theoretical example where additional user * criteria based on a custom user field "extra_access" * is checked. If the field "extra_access" is not "1" * then an error message is returned. */ add_filter( 'wpmem_securify', 'my_securify_filter' ); function my_securify_filter( $content ) { // If the user is logged in and the content is blocked. if ( is_user_logged_in() && wpmem_is_blocked() ) { $user_id = get_current_user_id(); $extra_access = get_user_meta( $user_id, 'extra_access', true ); if ( 1 != $extra_access ) { return "You do not have extra access!"; } } return $content; }
Not sure what to do with this code?
You're not a "coder" and don't know what to do? Don't worry! Code Snippets are the basic building blocks of WordPress customization, and once you know the basics, they are simple to use.
Here are some free articles to get you started:
- Using Code Snippets from the Site
- The functions.php File
- Create a plugin file for custom functions
- Create a child theme
- Do not modify plugin files!
For "hands on" help, consider a plugin support subscription or the Pro Bundle.