Automattic\WooCommerce\Blocks\Assets

Api::get_script_data_hash()privateWC 1.0

Generates a hash containing the site url, plugin version and package path.

Moving the plugin, changing the version, or changing the site url will result in a new hash and the cache will be invalidated.

Метод класса: Api{}

Хуков нет.

Возвращает

Строку. The generated hash.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->get_script_data_hash();

Код Api::get_script_data_hash() WC 9.5.1

private function get_script_data_hash() {
	return md5( get_option( 'siteurl', '' ) . $this->wc_version . $this->package->get_path() );
}