Description
This filters the post restricted message dialog.
The default message string is “<p>This content is restricted to site members. If you are an existing user, please log in. New users may register below.</p>”
Note that the message text can be customized in the plugin’s dialogs tab. Also, if you are running a translated version of the plugin, this string may likely be translated. Keep those things in mind if using this hook to use str_replace on any of the dialog text since str_replace will only work on an exact match.
Usage
/**
* @param string $str The post restricted message with HTML.
* @param string $msg The raw message string.
* @param string $before The 'before' HTML wrapper.
* @param string $after The 'after' HTML wrapper.
*/
add_filter( 'wpmem_restricted_msg', function( $str, $msg, $before, $after ) {
/*
* This example replaces the default <p> tag in the message
* string with one containing a custom class.
*/
$str = str_replace( '<p>', '<p class="my-custom-class">', $str );
return $str;
});