Automattic\WooCommerce\Database\Migrations

MigrationHelper::escape_and_add_backtick()public staticWC 1.0

Helper method to escape backtick in column and table names. WP does not provide a method to escape table/columns names yet, but hopefully soon in @link https://core.trac.wordpress.org/ticket/52506

{} It's a method of the class: MigrationHelper{}

No Hooks.

Return

Array|String|String[]. Escaped identifier.

Usage

$result = MigrationHelper::escape_and_add_backtick( $identifier );
$identifier(string|array) (required)
Column or table name.

Code of MigrationHelper::escape_and_add_backtick() WC 7.1.0

public static function escape_and_add_backtick( $identifier ) {
	return '`' . str_replace( '`', '``', $identifier ) . '`';
}