diff --git a/core/um-shortcodes.php b/core/um-shortcodes.php index e015891f..c0d681e7 100644 --- a/core/um-shortcodes.php +++ b/core/um-shortcodes.php @@ -11,7 +11,8 @@ class UM_Shortcodes { add_shortcode('ultimatemember', array(&$this, 'ultimatemember'), 1); add_shortcode('um_loggedin', array(&$this, 'um_loggedin') ); - + add_shortcode('um_loggedout', array(&$this, 'um_loggedout') ); + add_filter( 'body_class', array(&$this, 'body_class'), 0 ); $this->emoji[':)'] = 'https://s.w.org/images/core/emoji/72x72/1f604.png'; @@ -209,6 +210,25 @@ class UM_Shortcodes { return $output; } + /*** + *** @Logged-out only content + ***/ + function um_loggedout( $args = array(), $content = "" ) { + global $ultimatemember; + ob_start(); + + // Hide for logged in users + if ( is_user_logged_in() ) { + echo ''; + } else { + echo do_shortcode( wpautop( $content ) ); + } + + $output = ob_get_contents(); + ob_end_clean(); + return $output; + } + /*** *** @Shortcode ***/