WordPress.org

Support

User Roles

Viewing 1 replies (of 1 total)
  • We fixed this by editing the following file:

    \weekly-class-schedule\includes\WcsAdmin.php

    On line 36 to 39 there should be code like

    add_menu_page( $wc_schedule, $wc_schedule, 'manage_options', 'wcs-schedule', array( 'WcsAdmin', 'wcs_schedule_admin_page' ), WCS_PLUGIN_URL . '/images/favicon.ico' );
    add_submenu_page( 'wcs-schedule', $classes, $classes, 'manage_options', 'wcs-classes', array( 'WcsAdmin', 'wcs_classes_admin_page' ) );
    add_submenu_page( 'wcs-schedule', $instructors, $instructors, 'manage_options', 'wcs-instructors', array( 'WcsAdmin', 'wcs_instructors_admin_page' ) );
    add_submenu_page( 'wcs-schedule', $classrooms, $classrooms, 'manage_options', 'wcs-classrooms', array( 'WcsAdmin', 'wcs_classrooms_admin_page' ) );

    Change that to

    add_menu_page( $wc_schedule, $wc_schedule, 'publish_pages', 'wcs-schedule', array( 'WcsAdmin', 'wcs_schedule_admin_page' ), WCS_PLUGIN_URL . '/images/favicon.ico' );
    add_submenu_page( 'wcs-schedule', $classes, $classes, 'publish_pages', 'wcs-classes', array( 'WcsAdmin', 'wcs_classes_admin_page' ) );
    add_submenu_page( 'wcs-schedule', $instructors, $instructors, 'publish_pages', 'wcs-instructors', array( 'WcsAdmin', 'wcs_instructors_admin_page' ) );
    add_submenu_page( 'wcs-schedule', $classrooms, $classrooms, 'publish_pages', 'wcs-classrooms', array( 'WcsAdmin', 'wcs_classrooms_admin_page' ) );

    Basically the ‘manage_options’ is only available for administrators, ‘publish_pages’ for editors and so on, here’s a break down of the different options and the user level they are related to (Roles and Capabilities).

    http://codex.wordpress.org/Roles_and_Capabilities

    We didn’t bother changing the last line (line 40) as the editor doesn’t need to be able to access the WCS admin page.

    NOTE: when the plugin is updated, you will have to edit this page once again.

    Hope that helps.

Viewing 1 replies (of 1 total)
  • The topic ‘User Roles’ is closed to new replies.
Skip to toolbar