WordPress.org

Ready to get started?Download WordPress

Forums

Creating an admin menu (1 post)

  1. HorrorUK
    Member
    Posted 2 years ago #

    I'm trying to create a simple admin menu for a plugin, which has two text inputs to be stored in the database. Can anybody help me with this, as I can't figure it out.

    I have the following to create the actual menu and a page:

    <?php
    // Hook for adding admin menus
    add_action('admin_menu', 'mt_add_pages');
    // action function for above hook
    function mt_add_pages() {
    // Add a new submenu under Settings:
        add_options_page(__('Test Settings','menu-test'), __('Test Settings','menu-test'), 'manage_options', 'testsettings', 'mt_settings_page');
    } // Add this closing bracket
    // mt_settings_page() displays the page content for the Test settings submenu
    function mt_settings_page() {
        echo "<h2>" . __( 'Test Settings', 'menu-test' ) . "</h2>";
    }
    ?>

    My question is, how to create the info on the page, along with the two text inputs?

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.