• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

RocketGeek

Home of WP-Members, The Original WordPress Membership Plugin

  • WordPress Plugins
    • WP-Members
      • FAQs
      • Quick Start
      • Documentation
      • Extensions
    • Advanced Options
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Download Protect
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Invite Codes
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • MailChimp Integration
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • PayPal Subscriptions
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Salesforce Web-to-Lead
    • Security
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Text Editor
      • Purchase the Plugin
      • Get the Pro Bundle
    • User List
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • User Tracking
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Memberships for WooCommerce
    • WordPass
  • Store
    • Cart
    • Checkout
  • Blog
    • Basics [Free]
    • Tips and Tricks
    • Filters
    • Actions
    • Code Snippets
    • Shortcodes
    • Design
    • Release Announcements
  • Contact
  • Sign In
  • Show Search
Hide Search
Home » Plugins » WP-Members » Documentation » Customizing Forms » Login Form

Login Form

Display

This form will display in place of blocked content if enabled for that post type in the plugin’s main options.

This form can be displayed directly using the shortcode [wpmem_form login]

login_form

HTML

The following is the default HTML that is generated when the login form is displayed either in place of blocked content or from the [wpmem_form login] shortcode. This output can be changed by the use of filters in the functions used to create the form.

<div id="wpmem_login"><a id="login"></a>
  <form action="https://example.com/login/" method="POST" id="wpmem_login_form" class="form">
    <fieldset>
      <legend>Existing Users Log In</legend>
      <label for="log">Username Field</label>
      <div class="div_text">
        <input name="log" type="text" id="log" value="" class="username" />
      </div>
      <label for="pwd">Password Field</label>
      <div class="div_text">
        <input name="pwd" type="password" id="pwd" class="password" />
      </div>
      <input name="redirect_to" type="hidden" value="/login/" />
      <input name="a" type="hidden" value="login" />
      <div class="button_div">
        <input name="rememberme" type="checkbox" id="rememberme" value="forever" />
        &nbsp;
        <label for="rememberme">Remember Me</label>
        &nbsp;&nbsp;
        <input type="submit" name="Submit" value="Log In" class="buttons" />
      </div>
    </fieldset>
  </form>
</div>

Filters

Text and HTML in the login form can be changed by various filters that run during the process of building the form.

wpmem_inc_login_inputs
Filters information about the input fields including text labels, input field type, ID, class, and div wrapper class. Runs in wpmem_inc_login().

wpmem_inc_login_args
Filters information for the form including heading (legend tag), form action, button text, redirect. It can also filter the inputs from wpmem_inc_login_inputs as an array. Runs in wpmem_inc_login().

wpmem_login_form_args 
Filters the defaults for the form. Most of these are HTML tags that can be filtered and changed in order to set up custom attributes if you are tying into specific CSS other than WP-Members CSS.  Also filters specifc IDs and classes assigned to the form tag and the button tag.  Runs in WP_Members_Forms::login_form().

wpmem_login_form_rows
Filters components that will build each row in the form (for the login form there are 2 rows – username and password).  Rows are a numeric array containing information to assemble the HTML for the form.  This includes the label tag, HTML that comes before the input, the input field tag, and any HTML wrapping the row.  Runs in WP_Members_Forms::login_form().

wpmem_login_hidden_fields
Filters the HTML for hidden fields in the form.  Runs in WP_Members_Forms::login_form().

wpmem_login_form_buttons
Filters the HTML for the form button area.  NOTE: if you want to change the button text, do that with wpmem_inc_login_args.  Runs in WP_Members_Forms::login_form().

wpmem_forgot_link
Filters the forgot password URL used in the forgot password link.  Runs in WP_Members_Forms::login_form().

wpmem_forgot_link_str 
Filters the forgot password link as a string.   Runs in WP_Members_Forms::login_form().

wpmem_reg_link 
Filters the register URL used in the register link.  Runs in WP_Members_Forms::login_form().

wpmem_reg_link_str 
Filters the register  link as a string.   Runs in WP_Members_Forms::login_form().

wpmem_login_form_before  
This filter allows you to add HTML to display before the form.  This is an older filter and is generally not used.  It remains in the plugin for legacy purposes.  Runs in WP_Members_Forms::login_form().

wpmem_login_form 
Filters the generated form HTML once all of it has been assembled.  This filter generally is not used as the previous filters allow direct control over specific text, HTML tags, and properties that might be used for CSS styles.  However, it may be helpful in cases where a larger change may be necessary.  Runs in WP_Members_Forms::login_form().

Functions

wpmem_inc_login( $page, $redirect_to, $show );

This function is called to display the login form.  It sets up the heading, some of the HTML to be used, form field information, and ultimately runs the function to assemble the form HTML.  Upon completion, it returns a string of HTML for the form (see above).
[view function]

wpmem_login_form( $page, $arr );

This function actually builds the form based on the settings passed from wpmem_inc_login(). wpmem_login_form() is used to build the login form, but also password change, reset, and forgot username forms, so the HTML returned is based on settings passed to the function.
[view function]

  • Getting Started
  • Recommended WordPress® Settings
  • Plugin Settings
    • Options
    • Fields
    • Dialogs
    • Emails
    • New Feature Settings
  • Managing Content
    • Restricting Posts
    • Restricting Pages
    • Show Excerpts
    • Custom Post Types
  • Managing Users
  • Registration
    • Choosing Fields
    • Create a Registration Page
    • Moderating Registration
    • Using CAPTCHA
    • Removing Registration Options
  • User Profile
  • Membership Products
    • Membership Properties
  • Menus
    • Individual Menu Items
    • Logged In Menus
    • Login/Logout Menu Link
  • Customizing Emails
    • Email Address
    • Email Content
    • Email Format
    • Email Shortcodes
    • Email Troubleshooting
  • Customizing Forms
    • Create a Custom Stylesheet
    • Using the WordPress Customizer
    • Login Form HTML
    • Registration Form HTML
    • Widget Login Form HTML
  • Shortcodes
    • Pages and Forms
    • Login Status
    • User Fields
    • Email
    • Other Shortcodes
  • WP-CLI Commands
  • API Functions
  • Filter and Action Hooks
  • WP-Members FAQs
    • How to add a shortcode
    • How to apply login redirects
  • Demo Videos

Ready to get started?

Join Today!

© 2021 · butlerblog.com · RocketGeek is built using WordPress, WP-Members, and the Genesis Framework

  • butlerblog.com
  • WP-Members Support Subscription
  • Terms of Service
  • Refund Policy