Title: Contribution
Last modified: August 31, 2016

---

# Contribution

 *  [dedayoa](https://wordpress.org/support/users/dedayoa/)
 * (@dedayoa)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/contribution-5/)
 * Hi,
    I made some slight modification to your widget in my install and I think
   the larger community will benefit. I added a shortcode key to allow wrapping 
   the form and header in a div to which a user-defined class can be applied.
 * modified file is **login_afo_widget_shortcode.php**
 * It now looks like…
 *     ```
       <?php
       function login_widget_afo_shortcode( $atts ) {
            global $post;
       	 extract( shortcode_atts( array(
       	      'title' => '',
       	      ++ 'class' => '',
            ), $atts ) );
   
       	ob_start();
       	$wid = new login_wid;
       	++ echo '<div class="'.$class.'">';
       	if($title){
       		echo '<h2>'. esc_html( $title ) .'</h2>';
       	}
       	$wid->loginForm();
       	++ echo '</div>';
       	$ret = ob_get_contents();
       	ob_end_clean();
       	return $ret;
       }
       add_shortcode( 'login_widget', 'login_widget_afo_shortcode' );
   
       function forgot_password_afo_shortcode( $atts ) {
            global $post;
       	 extract( shortcode_atts( array(
       	      'title' => '',
       	      ++ 'class' => '',
            ), $atts ) );
   
       	ob_start();
       	$fpc = new afo_forgot_pass_class;
       	++ echo '<div class="'.$class.'">';
       	if($title){
       		echo '<h2>'. esc_html( $title ) .'</h2>';
       	}
       	$fpc->ForgotPassForm();
       	++ echo '</div>';
       	$ret = ob_get_contents();
       	ob_end_clean();
       	return $ret;
       }
       add_shortcode( 'forgot_password', 'forgot_password_afo_shortcode' );
       ```
   
 * I hope it’s not too much hassle moving this into your code.
 * [https://wordpress.org/plugins/login-sidebar-widget/](https://wordpress.org/plugins/login-sidebar-widget/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [aviplugins.com](https://wordpress.org/support/users/avimegladon/)
 * (@avimegladon)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/contribution-5/#post-7108164)
 * The login form is already wrapped in div with div id “log_forms”
    There is option
   to add CSS from the plugin settings page as well so I don’t think its required
   to put wrap the div again.

Viewing 1 replies (of 1 total)

The topic ‘Contribution’ is closed to new replies.

 * ![](https://ps.w.org/login-sidebar-widget/assets/icon-256x256.png?rev=2067421)
 * [Login Widget With Shortcode](https://wordpress.org/plugins/login-sidebar-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/login-sidebar-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/login-sidebar-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/login-sidebar-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/login-sidebar-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/login-sidebar-widget/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [aviplugins.com](https://wordpress.org/support/users/avimegladon/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/contribution-5/#post-7108164)
 * Status: not resolved