• 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
  • Blog
    • Basics
    • Tips and Tricks
    • Filters
    • Actions
    • Code Snippets
    • Shortcodes
    • Design
    • Release Announcements
  • Store
    • Cart
    • Checkout
  • Contact
  • Log In
  • Show Search
Hide Search
Home » Plugins » WP-Members » Documentation » Filter Hooks » wpmem_msg_dialog_arr

wpmem_msg_dialog_arr

Description

This filter allows you to filter the arguments for the error message function.  This allows all elements of the message to be filtered individually.  The wrappers are separate from the message string, so you can filter the message separately from the styles.

$defaults = array(
	'div_before' => '<div class="wpmem_msg" align="center">',
	'div_after'  => '</div>', 
	'p_before'   => '<p>',
	'p_after'    => '</p>',
	'toggles'    => array( 
			'user', 
			'email', 
			'success', 
			'editsuccess', 
			'pwdchangerr', 
			'pwdchangesuccess', 
			'pwdreseterr', 
			'pwdresetsuccess' 
		),
	'msg'        => $string
);

Parameters

$defaults
(array) (required) An array of arguments including defaults plus the message string.

$toggle
(string) (optional) Contains either the toggle for the message being generated or for additional messages, the custom message string.

$dialogs
(array) (optional) Contains an array of the message dialogs.

Changelog

Introduced in version 2.9.2
Added $dialogs paramter in 3.1.1

Source

wpmem_msg_dialog_arr is located in inc/dialogs.php

Usage

add_filter( 'wpmem_msg_dialog_arr', 'my_msg_dialog', 10, 2 );
function my_msg_dialog( $args, $toggle ) {
	/**
	 * This example changes the div wrapper to
	 * a different/custom class (default is .wpmem_msg).
	 */
	$args['div_before'] = '<div class="my_msg_class">';

	/**
	 * These example lines remove the '<p>' tag wrappers
	 */
	$args['p_before'] = '';
	$args['p_after']  = '';

	/**
	 * This example changes the div wrapper
	 * class based on a $toggle value (see defaults)
	 */
	if ( $toggle == 'success' ) {
		$args['div_before'] = '<div class="my_success_class">';
	}
	
	/** return any values you are setting **/
	return $args;
}

Code Snippet Library [Subscriber Content]

  • Add current password confirmation to change password form
See a list of all filter and action hooks

Ready to get started?

Join Today!

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

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