Traits

HasAdminPage

v1.0.0

Registers an admin menu page and handles the admin takeover mount point. Combines with AdminTakeoverInterface.

Example

has-admin-page.php
use Meteorack\SDK\Traits\HasAdminPage;

class My_Module implements ModuleInterface {
    use HasAdminPage;

    protected function admin_page_title(): string {
        return 'My Module';
    }

    protected function admin_page_capability(): string {
        return 'manage_options';
    }

    protected function admin_page_render(): void {
        echo '<div id="my-module-root"></div>';
    }
}