• Hello there,

    I’m writing a small plugin to track my computer repairs through the wordpress admin area.

    I’m trying to recreate similiar functions of the wordpress dashboard in my own plugin. I’m currently using the following: http://www.code-styling.de/english/how-to-use-wordpress-metaboxes-at-own-plugins
    Here is the pastebin of the sourcecode of that plugin. http://pastebin.com/uTS6jVEK

    However I’m trying to edit the following line:

    $this->pagehook = add_options_page('Howto Metabox Page Title', "HowTo Metaboxes", 'manage_options', 'howto_metaboxes', array(&$this, 'on_show_page'));

    Into:

    add_submenu_page('pctracker_dashboard', 'Dashboard', 'Dashboard', 10, 'pctracker_dashboard', 'pctracker_dashboard');

    I’m receiving the following error:
    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'pctracker_dashboard' not found or invalid function name in /home/sites/jmitservices.co.uk/public_html/pctracker/wp-includes/plugin.php on line 403

    Can anyone help?
    Thanks very much,
    Jason

Viewing 1 replies (of 1 total)
  • Thread Starter jmutton

    (@jmutton)

    I’ve managed to get it working by moving my menu code into the plugin.

    http://pastebin.com/eRHCuuHE

    However I’m still getting the following error above the top of the page. (Everything works tho!)

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'pctracker_dashboard' not found or invalid function name in /home/sites/xxxxx.co.uk/public_html/pctracker/wp-includes/plugin.php on line 403

Viewing 1 replies (of 1 total)

The topic ‘Metabox Showcase Plugin – Menu Problem’ is closed to new replies.