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: Filter the results of the discount code check. This can be used to add additional programmatic requirements to a discount code being used. Return true if discount code is okay to use. Return false or a string containing the error text if the discount code is not okay to use.
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 default level at checkout and place into the $pmpro_level global.
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: Sanitizes a given string in a specific context, particularly for handling HTML content in Paid Memberships Pro (PMPro) emails. This filter runs after the strings are passed through the core WordPress wp_kses function. The wp_kses function makes sure that only the allowed HTML element names, attribute names, attribute values, and HTML entities will occur in (more...)
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: Filter the body message for the no access message. This filter will change the content of the no access body text. Use the pmpro_no_access_message_header filter hook to change the heading in the box. To completely override the entire message, use the pmpro_no_access_message_html filter hook.
Filter Hook: Filter the header message for the no access message. This filter will change the content of the no access header text. Use the pmpro_no_access_message_body filter hook to change the inner content in the box. To completely override the entire message, use the pmpro_no_access_message_html filter hook.
Filter Hook: Filter the HTML of the no access message. This filter is the last to run on the no access / protected content message. Since this is a more powerful filter, consider using the the pmpro_no_access_message_header filter hook to change the heading in the box or the pmpro_no_access_message_body filter hook to change the content of the (more...)
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.
Filter Hook: Filter to determine if the Setup Wizard link should show. Allows you to bypass whether or not to show the link.
Filter Hook: Filter to include the expiration time with expiration date.
Action Hook: Allow hooking into after a webhook has been run but was not handled.