jeremyHixon / RationalOptionPages

PHP Class for building Option Pages in WordPress
MIT License
207 stars 73 forks source link

Display as a submenu item, not a main menu item? #9

Closed dan-bailey closed 3 years ago

dan-bailey commented 7 years ago

What would the sample code look like if I wanted to put my settings menu item as an item under the "Settings" main menu?

jeremyHixon commented 7 years ago

Something like this:

require_once('RationalOptionPages.php');
$pages = array(
    'sub-page-two'  => array(
        'parent_slug'   => 'options-general.php',
        'page_title'    => __( 'Sub Page Two', 'sample-domain' ),
    ),
);
$option_page = new RationalOptionPages( $pages );