• Skip to primary navigation
  • Skip to main content

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_sb_login_args

wpmem_sb_login_args

Description

This filter allows you to pass arguments to the sidebar login form function to override default values that are used in the form building process. The wpmem_do_sidebar function uses the wp_parse_args function to merge arguments passed through this filter with the following defaults:

$defaults = array(
	// wrappers
	'error_before'    => '<p class="err">',
	'error_after'     => '</p>',
	'fieldset_before' => '<fieldset>',
	'fieldset_after'  => '</fieldset>',
	'inputs_before'   => '<div class="div_texbox">',
	'inputs_after'    => '</div>',
	'buttons_before'  => '<div class="button_div">',
	'buttons_after'   => '</div>',

	// messages
	'error_msg'  => __( 'Login Failed!<br />You entered an invalid username or password.', 'wp-members' ),
	'status_msg' => __( 'You are not logged in.', 'wp-members' ) . '<br />',

	// other
	'strip_breaks'    => true,
	'wrap_inputs'     => true,
	'n'               => "\n",
	't'               => "\t",
);

Parameters

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

Changelog

Introduced in version 2.9.0

Source

wpmem_sb_login_args is located in wp-members-sidebar.php

Usage

add_filter( 'wpmem_sb_login_args', 'my_sidebar_args' );

function my_sidebar_args( $args ) {
	
	// This example changes the status message.
	$args['status_msg'] = 'Member Login <br />';

	return $args;
}

Code Snippet Library [Subscriber Content]

  • Customizing form CSS: Login widget with inline inputs
  • Customized sidebar widget
See a list of all filter and action hooks

Welcome to RocketGeek Interactive › Forums › Plugins › WP-Members › WP-Members Documentation › Filter Hooks › wpmem_sb_login_args

  • This topic has 4 replies, 2 voices, and was last updated 6 years, 1 month ago by Chad Butler.
Viewing 3 reply threads
  • Author
    Posts
    • April 19, 2014 at 4:20 pm #4688
      Chad Butler
      Keymaster

      Description This filter allows you to pass arguments to the sidebar login form function to override default values that are used in the form building
      [See the full post at: wpmem_sb_login_args]

    • February 20, 2015 at 3:17 pm #7220
      creativefedora
      Participant

      When I add this filter to the functions.php file and upload it causes a white screen, when I remove it the site displays. Any thoughts?

    • February 20, 2015 at 3:28 pm #7221
      Chad Butler
      Keymaster

      Two things to check first-
      Unique function names – the example uses “my_sidebar_args”. Any chance you’ve used that somewhere else already?
      If you elements to the array, did you separate them by comma? (I’ve added a comma to the example sine that fits better with the new WP code standards anyway.)

    • February 20, 2015 at 3:35 pm #7222
      creativefedora
      Participant

      Ha ha. I need to organize my wp-members area in my functions file. It’s in disarray as I work with the filters.

      I did find that I was already my_sidebar_args for error/status messages. Dropped in the array above and am back on track. Thanks.

      • February 21, 2015 at 7:40 pm #7236
        Chad Butler
        Keymaster

        No problem- glad that worked out!

  • Author
    Posts
Viewing 3 reply threads
  • You must be logged in to reply to this topic.
Log In

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