I have to create a custom table to store data for a client because they want a very precise search capability. I already have this working with custom post types and using custom fields, but with 800+ records it now takes 90+ seconds to search. (I know of no way to simplify this answer.) I'm taking the same idea and turning it into a custom table now.
So I've got the start of my plugin, the table definitions, and some basic pages by the add_object_page / add_submenu_page functions. However, I need the ability to edit a page so I found a function that lets me create a hidden page.
function add_admin_page($hook) {
global $_registered_pages;
$hookname = get_plugin_page_hookname($hook, 'admin.php');
if(!empty($hookname)) {
add_action($hookname, $hook);
$_registered_pages[$hookname] = true;
}
}
This works like a charm until I look at the header and notice that there's no page title defined for this callback. I've looked at plugin.php for the add_menu_item to see how it defines a title... and see no way for this custom page to display a title correctly.
So I thought about finding a hook and using a switch statement to override the title. Possible? Bad idea?
Another problem I have is that I'd like to use some of the scripts by wp_enqueue_script from within my callback, like "post" or "editor", and validate my form too, but the scripts I'm enqueuing aren't included in the payload. Should I include them in the footer of my callback?
add_admin_pagefunctions is hooked? – Mamaduka Oct 15 '11 at 8:10admin_menu. – Robert K Oct 15 '11 at 12:10