Class: \Conifer\Admin\SubPage (abstract)

Class for abstracting WP Admin pages

Example
```php
use Conifer\Admin\Page as AdminPage;
use Conifer\Admin\SubPage;
class MySettingsPage extends AdminPage {
  public function render() : string {
return '<h1>This is the top-level settings page</h1>';
  }
}
class MoreSettingsPage extends SubPage {
  public function render() : string {
return '<h1>This is a second-tier settings page</h1>';
  }
}
$page = new MySettingsPage('My Theme Settings');
// add your pages like this...
$page
  ->add()
  ->add_sub_page(MoreSettingsPage::class, 'More Theme Settings');
// ...or like this:
$page->add();
$subPage = new MoreSettingsPage($page, 'More Theme Settings');
$subPage->add();

```

Visibility Function
public __construct(\Conifer\Admin\Page $parent, \string $title, \string $menuTitle='', \string $capability='', \string $slug='')</strong> : void
Constructor for this submenu page. on this SubPage. admin menu. Defaults to the capabaility set on the parent AdminPage.
public add() : Page returns this SubPage
Add this SubPage to the WP Admin menu
public do_add() : Page returns this SubPage
The callback to the admin_menu action.

This class extends \Conifer\Admin\Page

results matching ""

    No results matching ""