PATH:
home
/
letacommog
/
aacote
/
wp-content
/
plugins
/
paid-memberships-pro
/
includes
<?php //make sure administrators have correct capabilities function pmpro_check_admin_capabilities() { // Grab the defined (needed) admin capabilities $roles = pmpro_get_capability_defs('administrator'); $caps_configured = true; // check whether the current user has those capabilities already foreach( $roles as $r ) { $caps_configured = $caps_configured && current_user_can($r); } // if not, set the if ( false === $caps_configured && current_user_can('administrator')) { pmpro_set_capabilities_for_role('administrator'); } } add_action('admin_init', 'pmpro_check_admin_capabilities', 5, 2); // use the capability definition for $role_name and add/remove capabilities as requested function pmpro_set_capabilities_for_role( $role_name, $action = 'enable' ) { $cap_array = pmpro_get_capability_defs($role_name); //add caps to specified role $role = get_role( $role_name ); // Iterate through the relevant caps for the role & add or remove them foreach( $cap_array as $cap_name ) { if ( $action == 'enable' ) $role->add_cap($cap_name); if ( $action == 'disable' ) $role->remove_cap($cap_name); } } // used to define what capabilities goes with what role. function pmpro_get_capability_defs($role) { // TODO: Add other standard roles (if/when needed) // caps for the administrator role $cap_array = array( 'pmpro_memberships_menu', 'pmpro_dashboard', 'pmpro_membershiplevels', 'pmpro_edit_memberships', 'pmpro_pagesettings', 'pmpro_paymentsettings', 'pmpro_emailsettings', 'pmpro_advancedsettings', 'pmpro_addons', 'pmpro_memberslist', 'pmpro_memberslistcsv', 'pmpro_reports', 'pmpro_orders', 'pmpro_orderscsv', 'pmpro_discountcodes', 'pmpro_updates', ); return apply_filters( "pmpro_assigned_{$role}_capabilities", $cap_array); }
[+]
..
[-] services.php
[edit]
[-] recaptcha.php
[edit]
[-] upgradecheck.php
[edit]
[-] rest-api.php
[edit]
[+]
updates
[-] email.php
[edit]
[-] updates.php
[edit]
[-] states.php
[edit]
[-] license.php
[edit]
[-] content.php
[edit]
[-] login.php
[edit]
[+]
compatibility
[-] https.php
[edit]
[-] metaboxes.php
[edit]
[-] localization.php
[edit]
[-] deprecated.php
[edit]
[-] notifications.php
[edit]
[-] adminpages.php
[edit]
[-] capabilities.php
[edit]
[-] profile.php
[edit]
[+]
lib
[-] cleanup.php
[edit]
[-] countries.php
[edit]
[-] sessions.php
[edit]
[-] currencies.php
[edit]
[-] addons.php
[edit]
[-] functions.php
[edit]
[-] filters.php
[edit]
[-] xmlrpc.php
[edit]
[-] setup.sql
[edit]
[-] compatibility.php
[edit]
[-] admin.php
[edit]
[-] privacy.php
[edit]
[-] pointers.php
[edit]
[-] init.php
[edit]
[-] reports.php
[edit]