WordPress.org

Ready to get started?Download WordPress

Forums

Weekly Class Schedule
User Roles (2 posts)

  1. jajouka
    Member
    Posted 11 months ago #

    Hi I can't seem to find out how allow users with the role of editor (for example) to use the plugin. Only administrator users have access to its menu item and page, is this something that is possible, thanks ,Simon

    http://wordpress.org/plugins/weekly-class-schedule/

  2. webmotionuk
    Member
    Posted 10 months ago #

    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.

Reply

You must log in to post.

About this Plugin

About this Topic