I have an issue with WordPress. I have the below code and I am getting into the admin menu:
public function Create_Menu()
{
add_menu_page("demoset", "Demoset", 'manage_options', "demoset", array( $this ,"MenuFunction"), '', 6);
add_submenu_page("demoset", "All Tables", "All Tables", 'manage_options', "demoset", array( $this ,"MenuFunction"));
add_submenu_page("demoset", "Create Tables", "Create Tables", 'manage_options', "demolist", array( $this ,"Submenu_Function"));
}
public function MenuFunction()
{
require_once ADMIN_VIEWS_PATH . 'view-dashboard.php';
}
public function Submenu_Function()
{
require_once ADMIN_VIEWS_PATH . 'view-create.php';
}
public function Edit_Function()
{
require_once ADMIN_VIEWS_PATH . 'view-edit.php';
}
I can access my pages using below links:
http://localhost:8080/wordpress/wp-admin/admin.php?page=demoset
http://localhost:8080/wordpress/wp-admin/admin.php?page=demolist
Now, My issue is, I have to use the below link and I have to call the Edit_Function
but I don't want to use the add_submenu_page
. Any idea how to use it?
http://localhost:8080/wordpress/wp-admin/admin.php?page=demoedit
view-edit.php
to logged out users somewhere on your site? Because you could display it somewhere that is not WP Admin, which would solve your problem, but it wouldn't answer your question. This looks like an X Y problem, where you asked how to implement your solution, instead of how to solve the original problem