Automattic\WooCommerce\Blocks\Assets
Api::get_script_data_hash()
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.
Method of the class: Api{}
No Hooks.
Return
String
. The generated hash.
Usage
// private - for code of main (parent) class only $result = $this->get_script_data_hash();
Api::get_script_data_hash() Api::get script data hash code WC 9.8.1
private function get_script_data_hash() { return md5( get_option( 'siteurl', '' ) . $this->wc_version . $this->package->get_path() ); }