• 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 » Filter Hooks » wpmem_register_form_args

wpmem_register_form_args

Description

This filter allows you to pass arguments to the registration form function to override default values that are used in the form building process. This includes default tags, labels, text, and small items including various booleans. The wpmem_inc_registration() function uses the wp_parse_args() function to merge arguments passed through this filter with the following defaults:

$defaults = array(

    // Wrappers.
    'heading_before'   => '<legend>',
    'heading_after'    => '</legend>',
    'fieldset_before'  => '<fieldset>',
    'fieldset_after'   => '</fieldset>',
    'main_div_before'  => '<div id="wpmem_reg">',
    'main_div_after'   => '</div>',
    'txt_before'       => '',
    'txt_after'        => '',
    'row_before'       => '',
    'row_after'        => '',
    'buttons_before'   => '<div class="button_div">',
    'buttons_after'    => '</div>',

    // Classes & ids.
    'form_id'          => ( 'new' == $tag ) ? 'wpmem_register_form' : 'wpmem_profile_form',
    'form_class'       => 'form',
    'button_id'        => '',
    'button_class'     => 'buttons',

    // Required field tags and text.
    'req_mark'         => $wpmem->get_text( 'register_req_mark' ),
    'req_label'        => $wpmem->get_text( 'register_required' ),
    'req_label_before' => '<div class="req-text">',
    'req_label_after'  => '</div>',

    // Buttons.
    'show_clear_form'  => false,
    'clear_form'       => $wpmem->get_text( 'register_clear' ),
    'submit_register'  => $wpmem->get_text( 'register_submit' ),
    'submit_update'    => $wpmem->get_text( 'profile_submit' ),

    // Other.
    'post_to'          => get_permalink(),
    'strip_breaks'     => true,
    'use_nonce'        => false,
    'wrap_inputs'      => true,
    'n'                => "\n",
    't'                => "\t",

);

Parameters

$args
(array) (required) An array of arguments that are to override form $defaults.

$toggle
(string) (optional) Indicates the form that is being displayed (new|edit).

Examples

/**
 * This example adds a div wrapper around each
 * row in the registration form.
 */
add_filter( 'wpmem_register_form_args', 'my_register_form_row_wrapper', 10, 2 );
function my_register_form_row_wrapper( $args, $tag ) {
    $args = array(
        'row_before' => '<div class="my-row-wrapper">',
        'row_after'  => '</div>',
    );
 
    return $args;
}


/**
 * The following example would change the
 * class assigned to buttons.
 */
add_filter( 'wpmem_register_form_args', 'my_register_form_button_class', 10, 2 );
function my_register_form_button_class( $args, $tag ) {
    $args['button_class'] = 'btn btn-primary';
    return $args;
}

Changelog

Introduced in version 2.9.0

Source

wpmem_register_form_args is located in inc/class-wp-members-forms.php

Related

wpmem_register_form_rows

Not sure what to do with this code?

You're not a "coder" and don't know what to do? Don't worry! Code Snippets are the basic building blocks of WordPress customization, and once you know the basics, they are simple to use.

Here are some free articles to get you started:

  • Using Code Snippets from the Site
  • Create a plugin file for custom functions
  • Create a child theme
  • Do not modify plugin files!

For "hands on" help, consider a plugin support subscription or the Pro Bundle.

  • 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 Hooks
  • Action Hooks
  • FAQs
    • How to add a shortcode
    • How to apply login redirects
    • Why can’t users log in?
    • Why does reCAPTCHA v3 fail?
    • How can I prevent registration spam?
    • Are files protected?
    • Why do I get a 403 error?
  • Demo Videos
  • How to Request Support
  • Copy Settings for Support

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