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.
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: 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: 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: 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: 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: 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: 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: Add additional template directories to search when loading page templates.