Skip to content

Instantly share code, notes, and snippets.

@Preciousomonze
Last active June 12, 2024 09:15
Show Gist options
  • Save Preciousomonze/c4e6168a4bde02a7eece84fd9c4645d5 to your computer and use it in GitHub Desktop.
Save Preciousomonze/c4e6168a4bde02a7eece84fd9c4645d5 to your computer and use it in GitHub Desktop.
Paid Membership Pro - How to get some functions you might not see in the documentation. happened to me a lot 😁

So I'll just try to be dumping some things here for docu purposes. Feel free to comment, if you have more to add. I'll try as much as possible to update.

Disclaimer: Please remember that we are all imperfect, and as such, some of the info here might be or outdated or incomplete, that's why we're a community. Any info you find incorrect, please do well to suggest the correct thing in the comment section, we're doing it for all of us. People powerrr

Note: That this also includes functions from their addons.

Format will be "Function name - Plugin name"

pmprorh_getProfileFields - Paid Membership Pro Registration Helper

Guess this helps get the fields from the profile.

  • Get the RH fields which are marked to show in the profile. If a $user_id is passed in, get fields based on the user's level.

function pmprorh_getProfileFields( $user_id, $withlocations = false )

pmpro_getAllLevels - Paid Membership Pro

Get all PMPro membership levels.

  • @param bool $include_hidden Include levels marked as hidden/inactive.
  • @param bool $use_cache If false, use $pmpro_levels global. If true use other caches.
  • @param bool $force Resets the static var caches as well.
  • @return array An array list of level(s) object

function pmpro_getAllLevels( $include_hidden = false, $use_cache = false, $force = false )

pmpro_sort_levels_by_order - Paid Membership Pro

Guess this helps get the fields from the profile.

  • Get an ordered list of level objects or level IDs.
  • @param array $pmpro_levels An array of level objects or level IDs to be reordered.
  • @return array $pmpro_levels An ordered array of level objects or level IDs.

function pmpro_sort_levels_by_order( $pmpro_levels )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment