Support

Account

Home Forums Add-ons Options Page Options Page 1.1.0 Issues Reply To: Options Page 1.1.0 Issues

  • Here’s the full function:


    function admin_menu()
    {
    // parent
    if( $this->settings['show_parent'] )
    {
    $parent_page = add_menu_page( $this->settings['title'], $this->settings['title'], $this->settings['capability'], $this->settings['slug'], array($this, 'html'));

    // actions
    add_action('load-' . $parent_page, array($this,'admin_load'));
    }

    // sub pages
    if( !empty( $this->settings['pages'] ) )
    {
    foreach( $this->settings['pages'] as $page )
    {
    $child_page = add_submenu_page( $page['parent'], $page['title'], $page['title'], $page['capability'], $page['slug'], array($this, 'html'));

    // actions
    add_action('load-' . $child_page, array($this,'admin_load'));
    }
    }

    }