Browse the database of various action and filter hooks available in Paid Memberships Pro. Select an action or filter to view detailed information, examples, and related articles with code recipes.

Show Action and Filter Hooks in:

Filter Hook: This filter changes the protocol used for URLs (https:// vs http://). If $besecure is set to true, the page will be loaded over HTTPS. For more information, read this blog post.

Filter Hook: Change the default separator in-between navigation links on the login screen.

Action Hook: Use this hook to execute custom code after a user’s membership level is changed or cancelled. This hook passes the new level ID, the user ID of the WordPress user, and the level ID being cancelled (if specified).

Filter Hook: This hook controls whether or not PMPro cancels a user’s previous membership level at checkout, which is enabled at default. This is dangerous, but is useful in certain cases like the PMPro Addon Packages plugin.

Filter Hook: This filter controls whether discount codes should only be applied to certain levels. By default, this is set to true, and discount codes are checked to see if they apply to the membership level passed. Return true if the code can be used with the level supplied or false if not.

Filter Hook: Filter whether old levels should be deactivated or not (default behavior is yes) when a member changes levels.

Filter Hook: Filters the list of CSS class names for the current element.

Filter Hook: Add additional template directories to search when loading email templates.

Filter Hook: Use this to filter the CSS classes added to the fields on the checkout page. This is normally used to handle error highlighting with the “pmpro_error” class. This returns the CSS classes and the current the current field name to be applied to.

Filter Hook: Format an address from address, city, state, zip, country, and phone. Useful for printing out the address on orders, emails, and more.

Filter Hook: Change how phone numbers are formated. Param 1 is $r, the formatted phone number. Param 2 is $phone, the original phone number

Filter Hook: Adjust the formatting of prices to support currency symbols after the price or to use commas instead of periods for separators

Filter Hook: The gateway which should be used when performing a checkout action.

Filter Hook: Filter and return the levels for a user ID or the currently logged-in user.

Filter Hook: Return the first active membership for a user.

Filter Hook: This filter can be used to override the output from the pmpro_hasMembershipLevel() function.  It passes the boolean true or false, user ID, and the array of required levels for that post passed to pmpro_hasMembershipLevel().

Filter Hook: Return whether the level is expiring soon or not.

Filter Hook: Filter to determine if PMPro setup is complete or if notices or warnings need to be shown in the PMPro settings. Note: The filter should return true or false and also set the $pmpro_level_ready, $pmpro_gateway_ready,$pmpro_pages_ready global variables.

Filter Hook: Retrieve level cost text from all levels.

Filter Hook: Change or filter the expiration text for a level.

Filter Hook: Overrides how the cost is shown on the checkout page. The hook passes the text generated by the pmpro_getLevelCost($level) function and also a level object which is prepopulated with levels pricing and expiration settings already adjusted for any discount codes that may be in effect.

Filter Hook: Overrides how the expiration information is shown on the levels and checkout pages. Again don’t abuse this by showing a different expiration than is real. Be careful if you change your expiration settings to update your filter if needed. The hook passes the text generated by the pmpro_getLevelExpiration($level) function and also a level object which (more...)

Filter Hook: Filter or change the arguments for displaying membership categories.

Filter Hook: Filters the pmpro_getMemberStartdate function. Passes the $user_id, and the $level_id as parameters.

Filter Hook: Filter the next payment date for a given user.

Filter Hook: Filters the message displayed when the post is viewed by a logged in WordPress user who does not have a membership level. By default, this is set to display the text configured on the Memberships > Settings > Advanced Settings page.

Filter Hook: Add additional template directories to search when loading page templates.