diff --git a/includes/bp-compliments-taxonomies.php b/includes/bp-compliments-taxonomies.php index 4e07df7..169ed6b 100644 --- a/includes/bp-compliments-taxonomies.php +++ b/includes/bp-compliments-taxonomies.php @@ -73,8 +73,10 @@ function create_compliment_taxonomies() { * @param string $hook_suffix Admin page suffix. */ function compliments_enqueue_admin_js( $hook_suffix ) { - wp_enqueue_media(); - wp_enqueue_script( 'compliments-adminjs', constant( 'BP_COMPLIMENTS_URL' ) . 'js/admin.js', array(), false, true ); + if (($hook_suffix == 'edit-tags.php' || $hook_suffix == 'term.php') && isset($_GET['taxonomy']) && $_GET['taxonomy'] == 'compliment') { + wp_enqueue_media(); + wp_enqueue_script( 'compliments-adminjs', constant( 'BP_COMPLIMENTS_URL' ) . 'js/admin.js', array(), false, true ); + } } /**