PPWP Pro Hooks, REST APIs, & Public Functions

Since version 1.3, Password Protect WordPress Pro provides RESTful APIs and public functions to achieve the following:

PPWP public action & filter hook

CategoryHookTypeAvailable on
Individual Protection
ppwp_qal_single_allowed_pagefilterPro
Partial Protection
ppwp_qal_pcp_allowed_pagefilterPro
Sitewide Protection
ppw_custom_header_form_entire_siteactionFree
ppw_custom_footer_form_entire_siteactionFree
ppwp_sitewide_headactionPro
ppwp_sitewide_footeractionPro
ppwp_sitewide_error_messagefilterPro

Where are sitewide passwords stored?

PPWP Free and Pro store sitewide passwords under wp_options table:

  • PPWP Free’s option name is wp_protect_password_set_password_options
  • PPWP Pro’s option name is ppw_entire_site_options

With PPWP Suite extension, we migrate sitewide passwords to our own wp_pda_passwords table for extended features management.

Change Shortcode Passwords Conditionally

Use the following hook to filter passwords shortcode attribute when protecting partial content.

add_filter( 'ppw_shortcode_passwords', 'ppw_filter_shortcode_passwords' );
/**
 * Filter PPWP Passwords.
 * 
 * @param array $passwords Array shortcode passwords.
 * 
 * @return array
 */
function ppw_filter_shortcode_passwords( $passwords ) {
	// Filter array passwords.
	return $passwords;
}
Lasted updated on October 7, 2020