Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin Name: My Extension
  4. Plugin URI:
  5. Description:
  6. Version: 1.0.0
  7. Author:
  8. Author URI:
  9. License: GPL2
  10. License URI: https://www.gnu.org/licenses/gpl-2.0.html
  11. Text Domain: myex-my-extension
  12. Domain Path: /languages
  13.  
  14. My Extension is free software: you can redistribute it and/or modify
  15. it under the terms of the GNU General Public License as published by
  16. the Free Software Foundation, either version 2 of the License, or
  17. any later version.
  18.  
  19. My Extension is distributed in the hope that it will be useful,
  20. but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. GNU General Public License for more details.
  23.  
  24. You should have received a copy of the GNU General Public License
  25. along with My Extension. If not, see https://www.gnu.org/licenses/gpl-2.0.html.
  26. */
  27.  
  28.  
  29.  
  30.  
  31.  
  32. if ( ! function_exists( 'myex_initialize_extension' ) ):
  33. /**
  34. * Creates the extension's main class instance.
  35. *
  36. * @since 1.0.0
  37. */
  38. function myex_initialize_extension() {
  39. require_once plugin_dir_path( __FILE__ ) . 'includes/MyExtension.php';
  40. }
  41. add_action( 'divi_extensions_init', 'myex_initialize_extension' );
  42. endif;
  43.  
  44. /**
  45. * Enqueues non-minified, hot reloaded javascript bundles.
  46. *
  47. * @since 3.1
  48. */
  49. protected function _enqueue_debug_bundles() {
  50. // Frontend Bundle
  51. $site_url = wp_parse_url( get_site_url() );
  52. $hot_bundle_url = "http://localhost:3000/static/js/frontend-bundle.js";
  53.  
  54. wp_enqueue_script( "{$this->name}-frontend-bundle", $hot_bundle_url, $this->_bundle_dependencies['frontend'], $this->version, true );
  55.  
  56. if ( et_core_is_fb_enabled() ) {
  57. // Builder Bundle
  58. $hot_bundle_url = "http://localhost:3000/static/js/builder-bundle.js";
  59.  
  60. wp_enqueue_script( "{$this->name}-builder-bundle", $hot_bundle_url, $this->_bundle_dependencies['builder'], $this->version, true );
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement