In writing my plugin, I have added my menus and submenus to the admin page. The pages load and function as intended. What I am trying to do is create some links inside of these pages that will pass a parameter to a new page. I am close to accomplishing this but the page always opens up outside of the admin screen. I am quite new at this and completely stuck.
Here is a screenshot.
Here is the function I am calling to get the post data which will pass the id to the page that handles the database edit.
add_action( 'admin_post_add_recid', 'prefix_admin_add_recid' );
function prefix_admin_add_recid() {
include( plugin_dir_path( __FILE__ ) . '/management_tools/edit.php' );
}
and the link that calls it, where 1 is the id that i need to pass to the edit page.
href="admin-post.php?action=add_recid&data=1"
Here is background on what/why I am doing this if you want to be bored. I am migrating content from a non-wordpress site. The only thing wordpress can't accommodate right out of the box is some old php database stuff that has been around for awhile. I want to put this database code into a plugin so that it can be managed within wordpress, backed up and migrated if that need ever arises. It is a specific use plugin that is not going to be distributed. The existing code hasn't been modified since it was created and probably won't need modified again once it is in wordpress. All of the database read and insert code is working inside of the plugin. Basically I am really close to completing the task without having to rewrite it from scratch which I don't have the budget to do. I just can't find a way to open the edit/delete admin pages inside of the admin panel. Thanks for reading and for any help you can offer.