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: Change the default separator in-between navigation links on the login screen.

Action Hook: Run code after all membership level changes have occured. Users who have had changes will be stored in the global $pmpro_old_user_levels array.

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: Specify which gateways support refund functionality.

Action Hook: Action to run custom code before the membership level changes.

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: Filter the new level for the user as passed in to the pmpro_changeMembershipLevel function before it is added to the member.

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: Filter the order statuses that cannot be refunded from.

Action Hook: Action hook to run additional code for when a specific gateway webhook is running.

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: Filter the formatted/output field names.

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: Filter to modify the price parts, add parts, or modify the display. Does not include the order total.

Filter Hook: Filter including the total price to modify the price parts, add parts, or modify the display.

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.

Filter Hook: Processes a refund for a specific gateway.

Action Hook: Filter to adjust whether the order can be refunded.

Filter Hook: Allow filtering whether to remove duplicate “active” memberships by setting them to “changed”.

Filter Hook: Allow filtering whether to send an early 200 HTTP response. The default for this hook is false.

Filter Hook: Filter to adjust the content of the message shown during any message handling script. Sets the value of the message shown to the user.

Action Hook: Allow hooking into after a webhook has been run but was not handled.