Skip to content

Commit

Permalink
Merge pull request #47 from 10up/fix/assets_enqueue
Browse files Browse the repository at this point in the history
Optimize assets loading
  • Loading branch information
felipeelia authored Jul 30, 2021
2 parents 6009b78 + 10ab25b commit c5a57f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions classes/class-ep-debug-bar-elasticpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ public function init() {
* Enqueue scripts for front end and admin
*/
public function enqueue_scripts_styles() {
wp_enqueue_script( 'debug-bar-elasticpress', plugins_url( '../assets/js/main.js', __FILE__ ), array( 'wp-dom-ready' ), EP_DEBUG_VERSION, true );
wp_enqueue_style( 'debug-bar-elasticpress', plugins_url( '../assets/css/main.css', __FILE__ ), array(), EP_DEBUG_VERSION );
if ( ! is_user_logged_in() ) {
return;
}

wp_enqueue_script( 'debug-bar-elasticpress', EP_DEBUG_URL . 'assets/js/main.js', array( 'wp-dom-ready' ), EP_DEBUG_VERSION, true );
wp_enqueue_style( 'debug-bar-elasticpress', EP_DEBUG_URL . 'assets/css/main.css', array(), EP_DEBUG_VERSION );
}

/**
Expand Down
1 change: 1 addition & 0 deletions debug-bar-elasticpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/

define( 'EP_DEBUG_VERSION', '2.0.0' );
define( 'EP_DEBUG_URL', plugin_dir_url( __FILE__ ) );

/**
* Register panel
Expand Down

0 comments on commit c5a57f3

Please sign in to comment.