script_data() ) . ';', 'before' ); wp_enqueue_style( 'wp-components' ); if ( is_readable( EXTROVA_PATH . 'build/admin.css' ) ) { wp_enqueue_style( self::HANDLE, EXTROVA_URL . 'build/admin.css', array( 'wp-components' ), $version ); } /** * Fires after the Lite admin app is enqueued (the Pro loads its app after it). * * @since 1.0.0 * * @param string $hook_suffix Hook suffix. */ do_action( 'extrova_admin_enqueue', $hook_suffix ); } /** * Initial data for the app. */ private function script_data(): array { $tax_classes = array( array( 'value' => '', 'label' => __( 'Standard', 'extrova' ), ), ); foreach ( \WC_Tax::get_tax_classes() as $name ) { $tax_classes[] = array( 'value' => sanitize_title( $name ), 'label' => $name, ); } $is_pro = $this->upsell->is_pro_active(); $data = array( 'version' => EXTROVA_VERSION, 'restNamespace' => RestExtrasController::REST_NAMESPACE, 'isProActive' => $is_pro, 'welcomeDismissed' => $is_pro || RestNoticesController::is_dismissed( 'welcome' ), 'upgradeUrls' => $is_pro ? (object) array() : array( 'proTab' => $this->upsell->url( 'pro_tab' ), 'rules' => $this->upsell->url( 'rules' ), 'analytics' => $this->upsell->url( 'analytics' ), 'welcome' => $this->upsell->url( 'welcome' ), ), 'taxClasses' => $tax_classes, 'taxesEnabled' => wc_tax_enabled(), 'pricesIncludeTax' => wc_prices_include_tax(), 'currency' => array( 'code' => get_woocommerce_currency(), 'symbol' => html_entity_decode( get_woocommerce_currency_symbol(), ENT_QUOTES, 'UTF-8' ), 'decimals' => wc_get_price_decimals(), 'position' => (string) get_option( 'woocommerce_currency_pos', 'left' ), 'decimal' => wc_get_price_decimal_separator(), 'thousands' => wc_get_price_thousand_separator(), ), 'shippingUrl' => admin_url( 'admin.php?page=wc-settings&tab=shipping' ), 'privacyUrl' => admin_url( 'admin.php?page=wc-settings&tab=account' ), 'unsupported' => $this->service->unsupported_ids(), ); /** * Filters the initial data of the admin app. * * @since 1.0.0 * * @param array $data Data. */ return (array) apply_filters( 'extrova_admin_script_data', $data ); } }