I've created a custom page in my wp-admin panel to show my custom model in a grid. It extends wp_list_table, and the grid works great with sorting and pagination. I'm having trouble adding an "Add New" button above the grid, however. I've added the button:
<a href="admin.php?page=certificates&action=new" class="add-new-h2">Add New</a>
And it takes me to the same page, with the action=new in the request, as expected. I'm not quite sure how to proceed from there, however. I'd like the page to display a form that lets the user add a new item when the URL contains that action, and otherwise display the grid. I tried adding a URL check to my process_bulk_action() function, as this is already looking for various actions in the URL, but it doesn't seem to call that function when clicking the "add new" button.
Does anyone have any advice on this, or a link to a guide which includes the add new button? All I've found are guides on removing that button, but that's not helpful when I haven't been able to get the button working in the first place.