'is-done', 'measure' => 'is-measure', 'clear' => 'is-clear', 'needs_setup' => 'is-needs-setup', 'idle' => 'is-idle', ); return isset( $map[ $state ] ) ? $map[ $state ] : 'is-idle'; } /** * Register and enqueue the landing stylesheet. * * A file rather than an inline block: the directory review of 1.26.3 asked * for exactly that, and the Free build's asset-hygiene gate fails on any * shipped PHP file that prints one. */ public static function enqueue() { $path = AI_O_Optimiser_PLUGIN_DIR . 'assets/admin-workspace-landing.css'; $ver = file_exists( $path ) ? AI_O_Optimiser_VERSION . '.' . filemtime( $path ) : AI_O_Optimiser_VERSION; wp_enqueue_style( self::HANDLE, AI_O_Optimiser_PLUGIN_URL . 'assets/admin-workspace-landing.css', array( 'ai-o-optimiser-admin', 'ai-o-optimiser-admin-modules' ), $ver ); } /** * Render a landing. * * @param array $landing { * @type string $eyebrow Short section label, above the heading. * @type string $heading One sentence saying what the workspace does. * Not a noun: "Titles and descriptions, scanned * across every page" rather than "Metadata". * @type string $summary Optional line under the heading. * @type array $cards One per section: title, description, icon, url, * state, badge. * } */ public static function render( array $landing ) { $cards = isset( $landing['cards'] ) && is_array( $landing['cards'] ) ? $landing['cards'] : array(); if ( array() === $cards ) { return; } ?>