Allow editor or other user roles to manage subscription plans and discount codes
-
I want to give a non-admin user access to certain admin-areas of PMS. With the solution described here, I could already implement this for the areas “Members”, “Payments” and “Reports”. However, for the “Subscription Plans” and “Discount codes” areas, I have not been able to make it work. I have extended the code for this as follows, but the last two areas remain locked for the non-admin user. Is there any way to extend these permissions?
add_filter( 'pms_submenu_page_capability', 'pmsc_allow_editors_to_view_pages', 20, 2 ); function pmsc_allow_editors_to_view_pages( $capability, $menu_slug ){ if( $menu_slug == 'pms-payments-page' || $menu_slug == 'pms-members-page' || $menu_slug == 'pms-reports-page' || $menu_slug == 'pms-export-page' || $menu_slug == 'edit.php?post_type=pms-subscription' || $menu_slug == 'edit.php?post_type=pms-discount-codes') return 'pms_edit_capability'; return $capability; }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Allow editor or other user roles to manage subscription plans and discount codes’ is closed to new replies.