Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // add this to your functions file
- add_shortcode('shortcode_name_here', 'my_login_form_shortcode');
- function my_login_form_shortcode( $attr ) {
- if ( is_user_logged_in() )
- return '';
- /* Set up some defaults. */
- $defaults = array(
- 'label_username' => 'Username',
- 'label_password' => 'Password'
- );
- /* Merge the user input arguments with the defaults. */
- $attr = shortcode_atts( $defaults, $attr );
- /* Set 'echo' to 'false' because we want it to always return instead of print for shortcodes. */
- $attr['echo'] = false;
- return wp_login_form( $attr );
- }
- // use this in your template
- echo do_shortcode('[shortcode_name_here label_username="Gebruikersnaam" label_password="Wachtwoord"]');
- // use this in your wordpress editor
- [shortcode_name_here label_username="Gebruikersnaam" label_password="Wachtwoord"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement