*/ protected function input_properties(): array { return array( 'settings' => array( 'description' => __( 'A map of setting name to value. Names outside the accepted list are refused, and the refusal lists what is accepted.', 'acrossai-abilities-manager' ) ), ); } /** * @since 0.0.34 * @return array */ protected function required_input(): array { return array( 'settings' ); } /** * @since 0.0.34 * @return array */ protected function output_properties(): array { return array( 'changed' => array( 'type' => 'object', 'additionalProperties' => true ), 'settings' => array( 'type' => 'object', 'additionalProperties' => true ), ); } /** * @since 0.0.34 * @return array */ protected function annotations(): array { return array( 'readonly' => false, 'destructive' => false, 'idempotent' => true, ); } /** * @since 0.0.34 * @return bool */ protected function requires_confirmation(): bool { return true; } /** * @since 0.0.34 * @return string */ protected function confirmation_message(): string { return __( 'These settings affect what customers see and are charged - currency, tax calculation and stock behaviour among them. Pass confirm: true to proceed.', 'acrossai-abilities-manager' ); } /** * @since 0.0.34 * @param array $input Input. * @return array|WP_Error */ protected function run( array $input ) { return Config_Repository::update_settings( (array) $input['settings'] ); } }