I am working on creating a suite of plugins that will build on each other and have specific functionality each instead of building on massive plugin. Kind of along the lines of WooCommerce. So I have a core plugin that creates a Admin menu page (empty at the moment, but it's a place holder). Then there are three other plugins that each create a submenu under the core plugin menu. I am building the menus the same way every time, but the last one I am getting permissions problem. I've tried checking file permissions, deactivating and reactivating the plugin, and removing and reinstalling the plugin. I used wppb.me to create the plugin templates.
The core plugin looks like the following:
plugin/includes/class-plugin.php::define_admin_hooks()
$this->loader->add_action ( 'admin_menu', $plugin_admin, 'add_plugin_admin_menu' );
plugin/admin/class-plugin-admin.php::add_plugin_admin_menu()
add_menu_page ( 'Plugin Core Settings', 'Plugin', 'manage_options', strtolower ( $this->plugin_name ), array (
$this,
'display_plugin_setup_page'
), 'dashicons-admin-generic', 2 );
add_submenu_page ( 'plugin-core', 'Core Settings', 'Core', 'manage_options', strtolower ( $this->plugin_name ), array(
$this,
'display_submenu_page'
));
plugin/includes/class-plugin.php::define_admin_hooks()
$this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_admin_menu' );
plugin/admin/class-plugin-admin.php::add_plugin_admin_menu()
add_submenu_page ( 'plugin-core', 'Plugin Settings', 'Settings', 'manage_options', strtolower ( $this->plugin_name ), array (
$this,
'display_plugin_setup_page'
) );
Another thing that might be contributing to the problem is that once that 3rd plugin is activated clicking on the menu tries to take me to the 3rd plugin settings page and not the core plugin settings page.
Any suggestions would be helpful! Thanks!