Created
November 20, 2019 19:38
-
-
Save dexit/71af889edaa67bdfe40592e873d34c1d to your computer and use it in GitHub Desktop.
Simple Member only shortcode for Wordpress
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 member_only_shortcode($atts, $content = null) | |
| { | |
| if (is_user_logged_in() && !is_null($content) && !is_feed()) { | |
| return $content; | |
| } | |
| } | |
| add_shortcode('member_only', 'member_only_shortcode'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment