Server IP : 66.29.132.122 / Your IP : 3.144.90.192 Web Server : LiteSpeed System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : admazpex ( 531) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/thread-self/root/var/softaculous/sitepad/editor/site-data/plugins/kkart-pro/packages/kkart-blocks/src/Assets/ |
Upload File : |
<?php namespace Automattic\Kkart\Blocks\Assets; /** * Backwards Compatibility class for plugins using wcSettings in prior versions. * * Note: This will be removed at some point. * * @internal * @since 2.5.0 */ class BackCompatAssetDataRegistry extends AssetDataRegistry { /** * Overrides parent method. * * @see AssetDataRegistry::enqueue_asset_data */ public function enqueue_asset_data() { $this->initialize_core_data(); $this->execute_lazy_data(); /** * Back-compat filter, developers, use 'kkart_shared_settings' * filter, not this one. * * @deprecated 2.5.0 */ $data = apply_filters( 'kkart_components_settings', $this->get() ); $data = rawurlencode( wp_json_encode( $data ) ); // for back compat with kkart-admin (or other plugins) that expects // wcSettings to be always available. // @see https://github.com/kkart/kkart-gutenberg-products-block/issues/932. echo '<script>'; echo "var wcSettings = wcSettings || JSON.parse( decodeURIComponent( '" . esc_js( $data ) . "' ) );"; echo '</script>'; } /** * Override parent method. * * @see AssetDataRegistry::get_core_data * * @return array An array of data to output for enqueued script. */ protected function get_core_data() { global $wp_locale; $core_data = parent::get_core_data(); return array_merge( $core_data, [ 'siteLocale' => $core_data['locale']['siteLocale'], 'stockStatuses' => $core_data['orderStatuses'], 'dataEndpoints' => [], 'l10n' => [ 'userLocale' => $core_data['locale']['userLocale'], 'weekdaysShort' => $core_data['locale']['weekdaysShort'], ], 'currency' => array_merge( $core_data['currency'], [ 'position' => $core_data['currency']['symbolPosition'], 'decimal_separator' => $core_data['currency']['decimalSeparator'], 'thousand_separator' => $core_data['currency']['thousandSeparator'], 'price_format' => $core_data['currency']['priceFormat'], ] ), ] ); } }