I'm writing a plugin that relies on custom post types, new taxonomy and few custom fields.

All this data will be private (not queryable or searchable).

I'd like to provide an admin page to the user, to add and edit this data in a more user-friendly way.

For instance, the custom post type will have only a title and the excerpt field, one taxonomy and the custom fields.

I know how to add meta boxes to a custom post type, but this is not enough to me.

I'd like to make a completely custom html interface that will take care of adding/saving/deleting the custom post type and handle the taxonomy and metas.

Just to be clear, I know already ho to write a normal plugin and handle plugin's options.

I don't know how, with this plugin I can:

  • Add a new menu item in Wordpress admin menu
  • In this menu item, handle, with a custom interface, the custom post type

There is some how-to out there that could help me achieve this?

  • 2
    A reason for the downvote would be appreciated Commented Apr 15, 2012 at 20:13
  • take a look at wordpress.org/extend/plugins/wp-user-frontend
    – Bainternet
    Commented Apr 16, 2012 at 6:43
  • Nainternet, it looks like I wasn't very clear about my question. I will update it appropriately. Commented Apr 16, 2012 at 7:24
  • I suggested that plugin since you can use it to create, update and delete cpt,taxonomy terms, and custom fields form the front-end which is basically what you want just look at its code.
    – Bainternet
    Commented Apr 16, 2012 at 7:52
  • 1
    Bainternet, I understand your point, but since mine is already a plugin, I don't want users to be forced to install another plugin to make mine working. I need a solution that I can implement inside my plugin. Actually what I need is just some guideline that helps me on getting this result. Commented Apr 16, 2012 at 11:20

3 Answers 3


You will need to start reading about the setting and options API, and then pull your CPT and Taxonomies into it.

Have a start here:


This is how it can be done:

add_action('admin_menu' , 'add_to_cpt_menu'); 

function add_to_cpt_menu() {
    add_submenu_page('edit.php?post_type=name_of_post_type', 'Custom Post Type Admin', 'Custom Settings', 'edit_posts', basename(__FILE__), 'cpt_menu_function');

Add menus and submenus like:

add_action('admin_menu', 'custom_plugin_menu');
function custom_plugin_menu() {
    $page_title = 'Parent Menu Title';
    $menu_title = 'Parent Menu Title';
    $capability = 'manage_options';
    $menu_slug = 'parent_menu_slug';
    $function = 'whatever_for_main_page_function';
    $icon_url = 'dashicons-admin-generic';
    $position = 4;
    add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position);

    $parent_slug = 'parent_menu_slug';
    $page_title = 'Submenu Page Title';
    $menu_title = 'Submenu Page Title';
    $capability = 'manage_options';
    $menu_slug = 'edit-tags.php?taxonomy=your_taxonomy_name&post_type=custom_post_type_name';
    $function = null;
    $position = null;
    add_submenu_page($parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function, $position);


add_filter('parent_file', 'menu_highlight');    
function menu_highlight($parent_file) {
    global $plugin_page, $submenu_file, $post_type, $taxonomy;
    if ('custom_post_type_name' == $post_type) {
        if ($taxonomy == 'your_taxonomy_name') {
            $plugin_page = 'edit-tags.php?taxonomy= your_taxonomy_name&post_type= custom_post_type_name'; // the submenu slug 
            $submenu_file = 'edit-tags.php?taxonomy= your_taxonomy_name&post_type= custom_post_type_name';    // the submenu slug
    return $parent_file;

Hope I put all that in correctly. Nest any else if's inside the taxonomy check and add same for other post types.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.