Last active
February 28, 2022 22:04
-
-
Save jaredatch/07ea7292a1ce655693a14c97f79273d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function user_function_restrict_content( $atts, $content = null ) { | |
if ( is_user_logged_in() && !is_null($content) && !is_feed() ) { | |
return do_shortcode( $content ); | |
} else { | |
return 'Sorry, this content is only available for logged users.'; | |
} | |
} | |
add_shortcode( 'member', 'user_function_restrict_content' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment