芝麻web文件管理V1.00
编辑当前文件:/home/ezdajrnh/public_html/wp-content/plugins/woocommerce/src/Blocks/Utils/BlocksSharedState.php
cart ); $cart_has_contents = $cart_exists && ! WC()->cart->is_empty(); if ( $cart_exists ) { $cart_controller = new CartController(); $cart_object = $cart_controller->get_cart_for_response(); $store_api = Package::container()->get( StoreApi::class ); $schema_controller = $store_api->container()->get( SchemaController::class ); $cart_schema = $schema_controller->get( CartSchema::IDENTIFIER ); $cart_response = $cart_schema->get_item_response( $cart_object ); self::$blocks_shared_cart_state = $cart_response; } else { self::$blocks_shared_cart_state = array(); } if ( $cart_has_contents ) { self::prevent_cache(); } wp_interactivity_state( 'woocommerce', array( 'cart' => self::$blocks_shared_cart_state, 'nonce' => wp_create_nonce( 'wc_store_api' ), 'noticeId' => '', 'restUrl' => get_rest_url(), ) ); } } /** * Get core data to include in settings. * * @return array */ private static function get_core_data() { return [ 'isBlockTheme' => wp_is_block_theme(), ]; } /** * Get currency data to include in settings. * * @return array */ private static function get_currency_data() { $currency = get_woocommerce_currency(); return [ 'currency' => [ 'code' => $currency, 'precision' => wc_get_price_decimals(), 'symbol' => html_entity_decode( get_woocommerce_currency_symbol( $currency ) ), 'symbolPosition' => get_option( 'woocommerce_currency_pos' ), 'decimalSeparator' => wc_get_price_decimal_separator(), 'thousandSeparator' => wc_get_price_thousand_separator(), 'priceFormat' => html_entity_decode( get_woocommerce_price_format() ), ], ]; } /** * Get locale data to include in settings. * * @return array */ private static function get_locale_data() { global $wp_locale; return [ 'locale' => [ 'siteLocale' => get_locale(), 'userLocale' => get_user_locale(), 'weekdaysShort' => array_values( $wp_locale->weekday_abbrev ), ], ]; } /** * Add placeholder image. * * @param string $consent_statement - The consent statement string. */ public function placeholder_image( $consent_statement ) { self::check_consent( $consent_statement ); wp_interactivity_config( self::$settings_namespace, array( 'placeholderImgSrc' => wc_placeholder_img_src() ) ); } }