WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

closed as too localized by toscho Dec 18 '12 at 23:57

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Where the add_admin_page functions is hooked? – Mamaduka Oct 15 '11 at 8:10
They're hooked in admin_menu. – Robert K Oct 15 '11 at 12:10