• Hi,

    I’m begenning an fairly ambition plugin project and i’m struggling to find documentation on how to do a few things.

    I would like my plougin to create it’s own tab in the admin area, on the top level, called “list-admin”. i have seen many, many plugins do this, and tried to pick apart their code, but have failed. is there documentation on how this works somewhere? am i missing it?

    I believe this is the code snippet from a popular ratings plugin that does what I want. but I don’t understand how it’s doing it.

    add_action(‘admin_menu’, ‘ratings_menu’);
    function ratings_menu() {
    if (function_exists(‘add_menu_page’)) {
    add_menu_page(__(‘Ratings’), __(‘Ratings’), ‘manage_ratings’, ‘postratings/postratings-manager.php’);
    }
    if (function_exists(‘add_submenu_page’)) {
    add_submenu_page(‘postratings/postratings-manager.php’, __(‘Manage Ratings’), __(‘Manage Ratings’), ‘manage_ratings’, ‘postratings/postratings-manager.php’);
    add_submenu_page(‘postratings/postratings-manager.php’, __(‘Ratings Options’), __(‘Ratings Options’), ‘manage_ratings’, ‘postratings/postratings-options.php’);
    }
    }

    thanks for your help.

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

    (@ehmcgregor)

    Oh, hey! I just found this: https://codex.www.ads-software.com/Adding_Administration_Menus

    Ok… i’m on the right track now.

    I’ll go ahead and get started on my next question. I would like to add specific list fields to “the post”. Right now, the post contains a ‘title’, a ‘body’ field. I would like to add specific columns in the database for ‘item number’, and ‘price’. So something could have a title, a description, an item number (different from post number) and a price.

    I don’t want to use ‘custom fields’. I just don’t like how they operate.

    what kind of implication would it have to add these columns to the wordpress post database table? how would it affect ‘the loop’.

Viewing 1 replies (of 1 total)
  • The topic ‘creating a new admin panel tab’ is closed to new replies.