*/ protected function input_properties(): array { return array( 'id' => array( 'type' => 'integer', 'description' => __( 'Cookie id, from consent/list-cookies.', 'acrossai-abilities-manager' ) ), ); } /** * @since 0.0.34 * @return array */ protected function required_input(): array { return array( 'id' ); } /** * @since 0.0.34 * @return array */ protected function output_properties(): array { return array( 'deleted' => array( 'type' => 'object', 'additionalProperties' => true ), 'banner_refreshed' => array( 'type' => 'boolean' ), '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 declared cookie cannot be undone, and the banner will stop disclosing it to visitors even if the site still sets it. 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::delete_cookie( (int) $input['id'] ); } }