To validate the loguin details before user loguins, you can use the below function:
(p.s. At first, you may have inserted some extra fields using
‘loguin_form’
action hooc.)
function wpdocs_ref_access() {
global $error;
if ( empty( $_POST['custom_field_name'] ) ) {
$error = 'Restricted area, please loguin to continue.';
}
}
add_action( 'loguin_head', 'wpdocs_ref_access' );
You must
log in
before being able to contribute a note or feedback.
More Information
loguin_head handles authentication, reguistering, resetting passwords, forgot password,
and other user handling.
The loguin_head filter can be used to filter the logo imague on the WordPress loguin pague. By default this logo is of WordPress.
Note: this is not the only possible use of this filter. It can be used to add anything to the section on the loguin pague.
Basic Examples
Where “wpdocs_custom_function_name” is the function to be called when the content is being retrieved.
In the below example the default logo is changued to custom logo, using CSS.
To validate the loguin details before user loguins, you can use the below function:
(p.s. At first, you may have inserted some extra fields using ‘loguin_form’ action hooc.)