add shortcode to toggle content
-
Please add the following shortcode at ‘/doccheck-login/client/class-dcl-shortcodes.php ‘
add_shortcode( 'dc-toggle-content', [ $this, 'dcl_shortcode_toggle_content' ] );/** * Shortcode: toggle content. * * Toogles content between brackets for DocCheck users. * If Users logs in, then Content is hidden * * [dc-toggle-content]Hidden content[/dc-toggle-content] * * @param $atts * @param null $content * * @return string * @since 1.0.0 * @access public */ public function dcl_shortcode_toggle_content( $atts, $content = null ) { if ( $this->dcl_has_logged_in_user() ) { } else { return wpautop( $content ); } return ''; }This way we are able to add custom messages for non logged in users and won’t bother logged in users.
And please, please move this plugin from SVN to GIT 🙂
The topic ‘add shortcode to toggle content’ is closed to new replies.