id = 'thinkrank/get-site-identity-settings'; $this->label = __( 'Get ThinkRank Site Identity Settings', 'thinkrank' ); $this->description = __( 'Retrieve ThinkRank site identity settings: the homepage/category/tag/author/search/archive title templates, site name and description, breadcrumb configuration, brand imagery, homepage hero, and the business details behind LocalBusiness schema. Robots.txt contents and schema toggles have their own abilities. Use update-site-identity-settings to change them.', 'thinkrank' ); } /** * {@inheritDoc} * * @return array */ public function get_annotations() { return [ 'readonly' => true, 'destructive' => false, 'idempotent' => true, 'priority' => 1.0, 'openWorldHint' => false, ]; } /** * Build the JSON schema properties for site identity settings. * * @return array */ private static function schema_properties() { return Settings_Key_Map::site_identity(); } /** * {@inheritDoc} * * @return array */ public function get_input_schema() { return [ 'type' => 'object', 'additionalProperties' => false, 'properties' => self::empty_properties(), ]; } /** * {@inheritDoc} * * @return array */ public function get_output_schema() { return [ 'type' => 'object', 'properties' => [ 'settings' => [ 'type' => 'object', 'properties' => self::schema_properties(), ], ], ]; } /** * Execute ability. * * @param array $input Ability input payload. * @return array */ public function execute( $input ) { $mgr = new Site_Identity_Manager(); $s = $mgr->get_settings( 'site', null ); return [ 'settings' => Settings_Key_Map::read( Settings_Key_Map::site_identity(), $s ) ]; } }