Created
April 24, 2020 11:40
-
-
Save elicus/74c21a8379523e5004ef65b59a07cd04 to your computer and use it in GitHub Desktop.
Function to fix error while creating custom divi module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
protected function _enqueue_bundles() { | |
// Frontend Bundle | |
$site_url = wp_parse_url( get_site_url() ); | |
$hot_bundle_url = "http://localhost:3000/static/js/frontend-bundle.js"; | |
wp_enqueue_script( "{$this->name}-frontend-bundle", $hot_bundle_url, $this->_bundle_dependencies['frontend'], $this->version, true ); | |
if ( et_core_is_fb_enabled() ) { | |
// Builder Bundle | |
$hot_bundle_url = "http://localhost:3000/static/js/builder-bundle.js"; | |
wp_enqueue_script( "{$this->name}-builder-bundle", $hot_bundle_url, $this->_bundle_dependencies['builder'], $this->version, true ); | |
} | |
} | |
protected function _enqueue_debug_bundles() { | |
// Frontend Bundle | |
$site_url = wp_parse_url( get_site_url() ); | |
$hot_bundle_url = "http://localhost:3000/static/js/frontend-bundle.js"; | |
wp_enqueue_script( "{$this->name}-frontend-bundle", $hot_bundle_url, $this->_bundle_dependencies['frontend'], $this->version, true ); | |
if ( et_core_is_fb_enabled() ) { | |
// Builder Bundle | |
$hot_bundle_url = "http://localhost:3000/static/js/builder-bundle.js"; | |
wp_enqueue_script( "{$this->name}-builder-bundle", $hot_bundle_url, $this->_bundle_dependencies['builder'], $this->version, true ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment