register( 'themes_list', array( 'description' => 'List installed themes (read-only).', 'domain' => 'themes', 'capability' => 'switch_themes', 'inputSchema' => array( 'type' => 'object', 'properties' => array() ), ), function () { $themes = wp_get_themes(); $active = get_stylesheet(); $items = array(); foreach ( $themes as $slug => $theme ) { $items[] = array( 'slug' => $slug, 'name' => $theme->get( 'Name' ), 'version' => $theme->get( 'Version' ), 'active' => $slug === $active, ); } return array( 'themes' => $items ); } ); $registry->register( 'themes_active', array( 'description' => 'Get the active theme details (read-only).', 'domain' => 'themes', 'capability' => 'switch_themes', 'inputSchema' => array( 'type' => 'object', 'properties' => array() ), ), function () { $theme = wp_get_theme(); return array( 'slug' => $theme->get_stylesheet(), 'name' => $theme->get( 'Name' ), 'version' => $theme->get( 'Version' ), 'description' => $theme->get( 'Description' ), 'author' => $theme->get( 'Author' ), 'template' => $theme->get_template(), ); } ); } );