'Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800', 'subset' => 'latin,latin-ext', ); wp_enqueue_style( 'et-fb-fonts', esc_url_raw( add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ) ), array(), null ); } function et_fb_enqueue_google_maps_dependency( $dependencies ) { if ( et_pb_enqueue_google_maps_script() ) { $dependencies[] = 'google-maps-api'; } return $dependencies; } add_filter( 'et_fb_bundle_dependencies', 'et_fb_enqueue_google_maps_dependency' ); function et_fb_load_portability() { et_core_register_admin_assets(); et_core_load_component( 'portability' ); // Register the Builder individual layouts portability. et_core_portability_register( 'et_builder', array( 'name' => esc_html__( 'Divi Builder Layout', 'et_builder' ), 'type' => 'post', 'view' => true, ) ); } function et_fb_enqueue_assets() { global $wp_version; et_fb_load_portability(); $ver = ET_BUILDER_VERSION; $root = ET_BUILDER_URI; $app = ET_FB_URI; $assets = ET_FB_ASSETS_URI; // Get WP major version $wp_major_version = substr( $wp_version, 0, 3 ); // Register styles. // wp_enqueue_style( 'et-frontend-builder', "{$assets}/css/frontend-builder.css", null, $ver ); // Register scripts. // wp_register_script( 'minicolors', "{$root}/scripts/ext/jquery.minicolors.js" ); wp_register_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 ); wp_register_script( 'wp-color-picker', admin_url( 'js/color-picker.min.js' ), array( 'iris' ), false, 1 ); if ( version_compare( $wp_major_version, '4.9', '>=' ) ) { wp_register_script( 'wp-color-picker-alpha', "{$root}/scripts/ext/wp-color-picker-alpha.min.js", array( 'jquery', 'wp-color-picker' ), ET_BUILDER_VERSION, true ); } else { wp_register_script( 'wp-color-picker-alpha', "{$root}/scripts/ext/wp-color-picker-alpha-48.min.js", array( 'jquery', 'wp-color-picker' ), ET_BUILDER_VERSION, true ); } $colorpicker_l10n = array( 'clear' => esc_html__( 'Clear', 'et_builder' ), 'defaultString' => esc_html__( 'Default', 'et_builder' ), 'pick' => esc_html__( 'Select Color', 'et_builder' ), 'current' => esc_html__( 'Current Color', 'et_builder' ), ); wp_localize_script( 'wp-color-picker', 'wpColorPickerL10n', $colorpicker_l10n ); wp_register_script( 'react-tiny-mce', "{$assets}/vendors/tinymce.min.js" ); if ( version_compare( $wp_major_version, '4.5', '<' ) ) { $jQuery_ui = 'et_pb_admin_date_js'; wp_register_script( $jQuery_ui, "{$root}/scripts/ext/jquery-ui-1.10.4.custom.min.js", array( 'jquery' ), $ver, true ); } else { $jQuery_ui = 'jquery-ui-datepicker'; } wp_register_script( 'et_pb_admin_date_addon_js', "{$root}/scripts/ext/jquery-ui-timepicker-addon.js", array( $jQuery_ui ), $ver, true ); wp_register_script( 'wp-shortcode', includes_url() . 'js/shortcode.js', array(), $wp_version ); wp_register_script( 'jquery-tablesorter', ET_BUILDER_URI . '/scripts/ext/jquery.tablesorter.min.js', array( 'jquery' ), ET_BUILDER_VERSION, true ); wp_register_script( 'chart', ET_BUILDER_URI . '/scripts/ext/chart.min.js', array(), ET_BUILDER_VERSION, true ); $dependencies_list = array( 'jquery', 'jquery-ui-core', 'jquery-ui-draggable', 'jquery-ui-resizable', 'underscore', 'jquery-ui-sortable', 'jquery-effects-core', 'iris', 'wp-color-picker', 'wp-color-picker-alpha', 'react-tiny-mce', 'et_pb_admin_date_addon_js', 'wp-shortcode', 'heartbeat', 'wp-mediaelement', 'jquery-tablesorter', 'chart', ); // Add dependency on et-shortcode-js only if Divi Theme is used or ET Shortcodes plugin activated if ( ! et_is_builder_plugin_active() || et_is_shortcodes_plugin_active() ) { $dependencies_list[] = 'et-shortcodes-js'; } $fb_bundle_dependencies = apply_filters( 'et_fb_bundle_dependencies', $dependencies_list ); // Adding concatenated script as dependencies for script debugging if ( et_load_unminified_scripts() ) { array_push( $fb_bundle_dependencies, 'easypiechart', 'salvattore', 'hashchange' ); } // enqueue the Avada script before 'et-frontend-builder' to make sure easypiechart ( and probably some others ) override the scripts from Avada. if ( wp_script_is( 'avada' ) ) { // dequeue Avada script wp_dequeue_script( 'avada' ); // enqueue it before 'et-frontend-builder' wp_enqueue_script( 'avada' ); } // Enqueue scripts. $bundle = "{$app}/bundle.js"; if ( defined( 'ET_DEBUG' ) && ET_DEBUG ) { $site_url = wp_parse_url( get_site_url() ); $hot_bundle_url = "{$site_url['scheme']}://{$site_url['host']}:31495/bundle.js"; wp_enqueue_script( 'et-frontend-builder', $hot_bundle_url, $fb_bundle_dependencies, $ver, true ); // Add the bundle as fallback in case webpack-dev-server is not running wp_add_inline_script( 'et-frontend-builder', sprintf( 'window.ET_FB || document.write(\'