How can I enforce password policies on custom login pages?

You are here:

When you install the Password Policy Manager for WordPress strong password policies are enforced on your users via the login, user profile and password reset pages.

This works out of the box if you use the default WordPress login, password reset and other pages. However, if you use WooCommerce or have a theme that uses custom login, user profile and other pages, policies cannot be enforced unless you integrate the plugin.

This article explains how you can easily enforce strong password policies on your custom password reset and user profile pages.

Call the plugin via the ppm_enable_custom_form hook

In WordPress a hook allows you to change the behaviour of a plugin or a specific module. Therefore if you use custom login and user profile pages you need to use the hook ppm_enable_custom_form to enforce the policies on the custom pages. Below is the hook code sample.

function example_ppm_enable_custom_form( $args ) {
$args = array( 'element' => '#custom_password, #password',  );
return $args;
}
add_filter( 'ppm_enable_custom_form', 'example_ppm_enable_custom_form' );

How can I use the hook?

To integrate the hook simply add the above code to your custom page code or to your site’s functions.php file. Refer to the functions.php documentation for more information on this file.