Description
The wpmem_msg_dialog filter allows you to filter the messages that are passed to the message dialog for error and success messages.
NOTE: The html that is passed to the filter includes the formatting tags.
Parameters
$str
(string)(required) The string containing the message to be displayed.
$tag
(string)(optional) The tag of the message being displayed:
user|email|success|editsuccess|pwdchangerr|pwdchangesuccess|pwdreseterr|pwdresetsuccess|custom
Usage
// General used framework.
add_filter( 'wpmem_msg_dialog', function( $str, $tag ) {
// filter the message based on the tag being passed.
return $str;
}, 10, 2 );
// Specific example to change
add_filter( 'wpmem_msg_dialog', function( $str, $tag ) {
// filter the message based on the tag being passed.
// "success" is the tag for successful registration.
if ( 'success' == $tag ) {
$str = "Thank you for registering. You may now sign in to view members only content.";
}
return $str;
}, 10, 2 );Changelog
- Introduced in 2.7.4
- 3.1.0 Added $tag parameter
Source
wpmem_msg_dialog is located in legacy/dialogs.php