Description
This filter allows you to add any string of HTML onto the front of the generated form. This filter is used on all “short” forms (i.e. login, password reset, password change, forgot username). For “long” forms (register, user profile), use wpmem_register_form_before.
Parameters
$html
(string) (required) The HTML you want to put above the form.
$action
(string) (optional) Specifies the form being displayed (login|pwdreset|pwdchange|getusername)
Usage
/** * This example will add the HTML before all "short forms" */ add_filter( 'wpmem_login_form_before', function( $html ) { return '<p>Some message here</p>'; }); /** * Specify the action to limit the message to before a * specific "short form" form. * * The possible action switches are: * - login * - pwdreset * - pwdchange * - getusername * * The following example would add a message before * the login form only: */ add_filter( 'wpmem_login_form_before', function( $html, $action ) { if ( 'login' == $action ) { return '<p>Some message here</p>'; } }, 10, 2 );
Changelog
Introduced in version 2.7.4
Source
wpmem_login_form_before is located in /includes/class-wp-members-forms.php