*/ protected function input_properties(): array { return array( 'selected' => array( 'type' => 'array', 'items' => array( 'type' => 'string' ), 'description' => __( 'Language codes to offer, for example en, de.', 'acrossai-abilities-manager' ) ), 'default' => array( 'type' => 'string', 'description' => __( 'Language to fall back to. Must be one of the selected languages.', 'acrossai-abilities-manager' ) ), ); } /** * @since 0.0.34 * @return array */ protected function required_input(): array { return array( 'selected' ); } /** * @since 0.0.34 * @return array */ protected function output_properties(): array { return array( 'languages' => array( 'type' => 'object', 'additionalProperties' => true ), 'rendered' => array( 'type' => 'boolean' ), 'pending_rebuild' => array( 'type' => 'boolean' ), ); } /** * @since 0.0.34 * @return array */ protected function annotations(): array { return array( 'readonly' => false, 'destructive' => true, 'idempotent' => false, ); } /** * @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 __( 'Removing a language discards every cookie description and category name stored for it, and that cannot be undone. 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 Consent_Repository::set_languages( (array) $input['selected'], isset( $input['default'] ) ? (string) $input['default'] : null ); } }