Automattic\WooCommerce\Blocks\AIContent

UpdatePatterns::sanitize_string()privateWC 1.0

Sanitize the string from the AI generated content. It removes double quotes that can cause issues when decoding the patterns JSON.

Method of the class: UpdatePatterns{}

No Hooks.

Return

String. The sanitized string.

Usage

// private - for code of main (parent) class only
$result = $this->sanitize_string( $string );
$string(string) (required)
The string to be sanitized.

UpdatePatterns::sanitize_string() code WC 9.8.2

private function sanitize_string( $string ) {
	return str_replace( '"', '', $string );
}