Forums

How to add metabox to custom menu page (not plugin)? (3 posts)

  1. gimperdaniel
    Member
    Posted 1 year ago #

    I know how to add metaboxes to custom post_types. But what I want is to add a metabox to a custom menu page I created... His my line of thinking which is apparently wrong:

    /*BACKEND SETTINGS&*/
    
    add_action('admin_menu', 'add_car_settings_page');
    
    function add_car_settings_page(){
    
        add_submenu_page('edit.php?post_type=inventory', 'Inventory Settings', 'Inventory Settings', 'manage_options', 'my-inventory-settings', 'add_car_settings');
    
    }
    
    function add_car_settings(){
    
        echo"hi";
    
        add_meta_box('my-car-settings', 'Car Inventory Settings', 'add_car_settings_form', 'my-inventory-settings', 'normal', 'high');
    
    }
    
    function add_car_settings_form($post){
    
        echo"my metabox";
    
    }
  2. David Gwyer
    Member
    Posted 1 year ago #

    This could be what you need:

    http://andrewferguson.net/2008/09/26/using-add_meta_box/

    It shows how to specifically add meta boxes to your Plugin options pages.

  3. gimperdaniel
    Member
    Posted 1 year ago #

    Thanks for your reply. Haven't had a chance to go through it all yet, but it looks like what i'm looking for... thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic