Make the settings page capability filterable
-
Instead of using hard coded
manage_options
capability to add UserWay menu item, you should make it filterable, so that we can give access to a any capability we prefer.// Current method in includes/admin.php add_menu_page( 'UserWay', 'UserWay', 'manage_options', 'userway', 'usw_userway_settings_page', 'dashicons-universal-access-alt' ); // New method add_menu_page( 'UserWay', 'UserWay', apply_filters( 'usw_settings_capability', 'manage_options' ), 'userway', 'usw_userway_settings_page', 'dashicons-universal-access-alt' );
- The topic ‘Make the settings page capability filterable’ is closed to new replies.