Menu slug => label.
*/
private static function screens() {
return array(
Admin_Page::MENU_SLUG => __( 'Convert', 'esipher' ),
Github_Admin_Page::MENU_SLUG => __( 'Connected Projects', 'esipher' ),
Mobile_App_Admin_Page::MENU_SLUG => __( 'Mobile App', 'esipher' ),
);
}
/**
* Open the page wrapper and print the branded header.
*
* The screen-reader-only h1 comes first on purpose: WordPress moves
* notices from other plugins to just after the first heading, which
* keeps them above the header instead of inside a card.
*
* @param string $current Menu slug of the screen being rendered.
* @param string $title Accessible page title.
*/
public static function open( $current, $title ) {
echo '
';
}
/**
* Open a card with a tinted title bar.
*
* @param string $title Card heading.
* @param string $desc Optional one-line plain-text description.
*/
public static function card_open( $title, $desc = '' ) {
echo '
';
echo '
' . esc_html( $title ) . '
';
if ( '' !== $desc ) {
echo '
' . esc_html( $desc ) . '
';
}
echo '
';
}
/**
* Close a card.
*/
public static function card_close() {
echo '
';
}
/**
* Open a two-column layout with a side menu.
*
* @param array $items Items keyed by id.
* @param string $current Active item id.
* @param string $label Accessible name for the menu.
*/
public static function side_open( array $items, $current, $label ) {
echo '
';
echo '
';
}
/**
* Close the side-menu layout.
*/
public static function side_close() {
echo '
';
}
/**
* A status pill.
*
* @param string $label Visible text.
* @param string $tone One of ok, warn, err, info or '' for neutral.
*
* @return string Escaped HTML.
*/
public static function pill( $label, $tone = '' ) {
$class = 'esipher-pill' . ( in_array( $tone, array( 'ok', 'warn', 'err', 'info' ), true ) ? ' esipher-pill--' . $tone : '' );
return '' . esc_html( $label ) . '';
}
}