WordPress at Your Fingertips
function is not described


AssetDataRegistry::enqueue_asset_data() public WC 1.0

Callback for enqueuing asset data via the WP api.

Note: while this is hooked into print/admin_print_scripts, it still only happens if the script attached to wc-settings handle is enqueued. This is done to allow for any potentially expensive data generation to only happen for routes that need it.

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

No Hooks.


null. Nothing.


$AssetDataRegistry = new AssetDataRegistry();

Code of AssetDataRegistry::enqueue_asset_data() WC 5.6.0

public function enqueue_asset_data() {
	if ( wp_script_is( $this->handle, 'enqueued' ) ) {
		$data = rawurlencode( wp_json_encode( $this->data ) );
			"var wcSettings = wcSettings || JSON.parse( decodeURIComponent( '"
				. esc_js( $data )
				. "' ) );",