Title: [groups_login]  Shortcode doesn&#039;t render a form
Last modified: September 1, 2016

---

# [groups_login] Shortcode doesn't render a form

 *  Resolved [asha23](https://wordpress.org/support/users/asha23/)
 * (@asha23)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/groups_login-shortcode-doesnt-render-a-form/)
 * It looks like the groups_login shortcode is broken. It doesn’t render the form.
 * I have looked into the plugin and where the shortcode lives, but it doesn’t seem
   to do anything.
 * Any ideas?
 * [https://wordpress.org/plugins/groups/](https://wordpress.org/plugins/groups/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Kento](https://wordpress.org/support/users/proaktion/)
 * (@proaktion)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/groups_login-shortcode-doesnt-render-a-form/#post-7498214)
 * Hi,
 * If you don’t get the form, you’re probably logged in already or you had caching
   enabled when you visited your test page and visited it first while you were logged
   in. Try to log out and empty the cache please, also you can add the `[groups_logout]`
   shortcode.
 * References:
    – [http://docs.itthinx.com/document/groups/shortcodes/groups_login/](http://docs.itthinx.com/document/groups/shortcodes/groups_login/)–
   [http://docs.itthinx.com/document/groups/shortcodes/groups_logout/](http://docs.itthinx.com/document/groups/shortcodes/groups_logout/)
 * Cheers
 *  Thread Starter [asha23](https://wordpress.org/support/users/asha23/)
 * (@asha23)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/groups_login-shortcode-doesnt-render-a-form/#post-7498424)
 * Hi,
 * I’m afraid it’s neither of those things. I am using the groups_logout shortcode.
   Still nothing.
 * Can you explain what I should see when using the groups_login shortcode? I have
   looked at your shortcode plugin code (class-groups-shortcode.php) and can’t see
   the hook to render a login form.
 * It appears to render a url? Is this correct?
 *  Thread Starter [asha23](https://wordpress.org/support/users/asha23/)
 * (@asha23)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/groups_login-shortcode-doesnt-render-a-form/#post-7498425)
 * Looking at this line of code in class-groups-shortcode.php
 *     ```
       $output .= wp_login_form(
        array(
         'echo'     => false,
         'redirect' => $redirect
        )
       );
       ```
   
 * This doesn’t render the form, unless you set the echo to true.
 *  Thread Starter [asha23](https://wordpress.org/support/users/asha23/)
 * (@asha23)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/groups_login-shortcode-doesnt-render-a-form/#post-7498427)
 * This, however does work. Rather confused – Not keen to change plugin code. But
   I really needed this functionality to work correctly
 *     ```
       public static function groups_login( $atts, $content = null ) {
       	$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
   
       	extract(
       		shortcode_atts(
       			array(
       				'redirect'        => $current_url,
       				'show_logout'     => 'no'
       			),
       			$atts
       		)
       	);
   
       	$redirect    = trim( $redirect );
   
       	$show_logout = trim( strtolower( $show_logout ) );
       	$output      = '';
   
       	if ( !is_user_logged_in() ) {
   
       		$output .= wp_login_form(
       			array(
       				'echo'     => true,
       				'redirect' => $redirect
       			)
       		);
       	} else {
       		if ( $show_logout == 'yes' ) {
   
       			$output .= self::groups_logout(
       				array(
       					'redirect' => $redirect
       				)
       			);
       		}
       	}
       	echo $output;
       	// return $output;
       }
       ```
   
 *  Thread Starter [asha23](https://wordpress.org/support/users/asha23/)
 * (@asha23)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/groups_login-shortcode-doesnt-render-a-form/#post-7498520)
 * This is not resolved.
 *  Plugin Author [Kento](https://wordpress.org/support/users/proaktion/)
 * (@proaktion)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/groups_login-shortcode-doesnt-render-a-form/#post-7498556)
 * There is no need to modify the code and the shortcode works correctly. If you
   are using the function directly then you must echo its return value.
 *  Plugin Author [Kento](https://wordpress.org/support/users/proaktion/)
 * (@proaktion)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/groups_login-shortcode-doesnt-render-a-form/#post-7498557)
 * For wp_login_form see [https://codex.wordpress.org/Function_Reference/wp_login_form](https://codex.wordpress.org/Function_Reference/wp_login_form)
 *  Plugin Author [Kento](https://wordpress.org/support/users/proaktion/)
 * (@proaktion)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/groups_login-shortcode-doesnt-render-a-form/#post-7498572)
 * I assume this has helped you and will mark this thread as resolved. If you need
   further help, please let me know.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘[groups_login] Shortcode doesn't render a form’ is closed to new replies.

 * ![](https://ps.w.org/groups/assets/icon-256x256.png?rev=983146)
 * [Groups](https://wordpress.org/plugins/groups/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/groups/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/groups/)
 * [Active Topics](https://wordpress.org/support/plugin/groups/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/groups/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/groups/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [Kento](https://wordpress.org/support/users/proaktion/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/groups_login-shortcode-doesnt-render-a-form/#post-7498572)
 * Status: resolved