Skip to main content
added 74 characters in body
Source Link
Steven
  • 2.6k
  • 7
  • 41
  • 61

I'm adding an extra menu item in admin menu by using add_menu_page.

add_menu_page('Calendar', 'Calendar', 'edit_posts', 'wp-eventcal/eventcal-manager.php');

Still my editors do not see the menu item. Why not? Any user that can edit a post, should now be able to see the menu item.

Update

This is the code:

  // Define some constants
  define('WP_CAL_PLUGIN_DIR', trailingslashit( str_replace("\\","/", dirname(__FILE__) ) ) );
  define('WP_CAL_PLUGIN_URL', trailingslashit( str_replace("\\","/", dirname(__FILE__) ) ) );


  // Plugin activation / deactivation script
  register_activation_hook(__FILE__,'event_cal_install');
  
  // create custom plugin settings menu
  if ( function_exists('add_action') ) {
    add_action('admin_menu', 'event_cal_menu');
    add_shortcode('eventcal', 'shortcode_display_event');
  }

function event_cal_menu() {
    //create new top-level menu
    add_menu_page('Calendar', 'Calendar', 'read', 'wp-eventcal/eventcal-manager.php');
}

Could it be admin_init in add_action that gives me problems?

Update 2
If I log in as administrator, I can see the menu item.

I'm adding an extra menu item in admin menu by using add_menu_page.

add_menu_page('Calendar', 'Calendar', 'edit_posts', 'wp-eventcal/eventcal-manager.php');

Still my editors do not see the menu item. Why not? Any user that can edit a post, should now be able to see the menu item.

Update

This is the code:

  // Define some constants
  define('WP_CAL_PLUGIN_DIR', trailingslashit( str_replace("\\","/", dirname(__FILE__) ) ) );
  define('WP_CAL_PLUGIN_URL', trailingslashit( str_replace("\\","/", dirname(__FILE__) ) ) );


  // Plugin activation / deactivation script
  register_activation_hook(__FILE__,'event_cal_install');
  
  // create custom plugin settings menu
  if ( function_exists('add_action') ) {
    add_action('admin_menu', 'event_cal_menu');
    add_shortcode('eventcal', 'shortcode_display_event');
  }

function event_cal_menu() {
    //create new top-level menu
    add_menu_page('Calendar', 'Calendar', 'read', 'wp-eventcal/eventcal-manager.php');
}

Could it be admin_init in add_action that gives me problems?

I'm adding an extra menu item in admin menu by using add_menu_page.

add_menu_page('Calendar', 'Calendar', 'edit_posts', 'wp-eventcal/eventcal-manager.php');

Still my editors do not see the menu item. Why not? Any user that can edit a post, should now be able to see the menu item.

Update

This is the code:

  // Define some constants
  define('WP_CAL_PLUGIN_DIR', trailingslashit( str_replace("\\","/", dirname(__FILE__) ) ) );
  define('WP_CAL_PLUGIN_URL', trailingslashit( str_replace("\\","/", dirname(__FILE__) ) ) );


  // Plugin activation / deactivation script
  register_activation_hook(__FILE__,'event_cal_install');
  
  // create custom plugin settings menu
  if ( function_exists('add_action') ) {
    add_action('admin_menu', 'event_cal_menu');
    add_shortcode('eventcal', 'shortcode_display_event');
  }

function event_cal_menu() {
    //create new top-level menu
    add_menu_page('Calendar', 'Calendar', 'read', 'wp-eventcal/eventcal-manager.php');
}

Could it be admin_init in add_action that gives me problems?

Update 2
If I log in as administrator, I can see the menu item.

added code
Source Link
Steven
  • 2.6k
  • 7
  • 41
  • 61

I'm adding an extra menu item in admin menu by using add_menu_page.

add_menu_page('Calendar', 'Calendar', 'edit_posts', 'wp-eventcal/eventcal-manager.php');

Still my editors do not see the menu item. Why not? Any user that can edit a post, should now be able to see the menu item.

Update

This is the code:

  // Define some constants
  define('WP_CAL_PLUGIN_DIR', trailingslashit( str_replace("\\","/", dirname(__FILE__) ) ) );
  define('WP_CAL_PLUGIN_URL', trailingslashit( str_replace("\\","/", dirname(__FILE__) ) ) );


  // Plugin activation / deactivation script
  register_activation_hook(__FILE__,'event_cal_install');
  
  // create custom plugin settings menu
  if ( function_exists('add_action') ) {
    add_action('admin_menu', 'event_cal_menu');
    add_shortcode('eventcal', 'shortcode_display_event');
  }

function event_cal_menu() {
    //create new top-level menu
    add_menu_page('Calendar', 'Calendar', 'read', 'wp-eventcal/eventcal-manager.php');
}

Could it be admin_init in add_action that gives me problems?

I'm adding an extra menu item in admin menu by using add_menu_page.

add_menu_page('Calendar', 'Calendar', 'edit_posts', 'wp-eventcal/eventcal-manager.php');

Still my editors do not see the menu item. Why not? Any user that can edit a post, should now be able to see the menu item.

I'm adding an extra menu item in admin menu by using add_menu_page.

add_menu_page('Calendar', 'Calendar', 'edit_posts', 'wp-eventcal/eventcal-manager.php');

Still my editors do not see the menu item. Why not? Any user that can edit a post, should now be able to see the menu item.

Update

This is the code:

  // Define some constants
  define('WP_CAL_PLUGIN_DIR', trailingslashit( str_replace("\\","/", dirname(__FILE__) ) ) );
  define('WP_CAL_PLUGIN_URL', trailingslashit( str_replace("\\","/", dirname(__FILE__) ) ) );


  // Plugin activation / deactivation script
  register_activation_hook(__FILE__,'event_cal_install');
  
  // create custom plugin settings menu
  if ( function_exists('add_action') ) {
    add_action('admin_menu', 'event_cal_menu');
    add_shortcode('eventcal', 'shortcode_display_event');
  }

function event_cal_menu() {
    //create new top-level menu
    add_menu_page('Calendar', 'Calendar', 'read', 'wp-eventcal/eventcal-manager.php');
}

Could it be admin_init in add_action that gives me problems?

Source Link
Steven
  • 2.6k
  • 7
  • 41
  • 61

Not able to give editors acess to new admin menu item

I'm adding an extra menu item in admin menu by using add_menu_page.

add_menu_page('Calendar', 'Calendar', 'edit_posts', 'wp-eventcal/eventcal-manager.php');

Still my editors do not see the menu item. Why not? Any user that can edit a post, should now be able to see the menu item.