..., 'owner' => 'pro', 'description' => ..., 'tips' => array( ... ) ) ); * PageLayout::section_start( __( 'Give access' ) ); * ... the section's own markup ... * PageLayout::section_end(); * PageLayout::end(); * * WordPress's own markup inside (form tables, list tables, `.button`s) is * restyled by the `.aiou-page` rules in admin.css. */ final class PageLayout { /** * The pages being drawn (a stack, in case one renders inside another). * * @var array> */ private static array $pages = array(); /** * Open the page: wrap, title, layout and main column. * * @param array $args { * Page settings. * * @type string $title Page title (plain text). * @type string $owner 'free', 'pro', 'woo' or 'tools' -- tints the sections and badges the sidebar. * @type string $description Sidebar text. * @type string[] $tips Sidebar tips. * @type string $class Extra classes for the wrap. * @type string $actions HTML shown beside the title (e.g. an "Add new" link). Output as-is: * the caller must build it from escaped parts. * @type string $back_url Optional "back" link above the title. * @type string $back_label Its text. * } * @return void */ public static function start( array $args ): void { $args = wp_parse_args( $args, array( 'title' => '', 'owner' => 'free', 'description' => '', 'tips' => array(), 'class' => '', 'actions' => '', 'back_url' => '', 'back_label' => '', ) ); self::$pages[] = $args; ?>

←


> >

'; } /** * Close the page: main column, then the Documentation sidebar. * * @return void */ public static function end(): void { $page = array_pop( self::$pages ); if ( ! $page ) { return; } ?>