Title: Enqueueing scripts only if not in queue already
Last modified: August 19, 2016

---

# Enqueueing scripts only if not in queue already

 *  [voidtrance](https://wordpress.org/support/users/voidtrance/)
 * (@voidtrance)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/enqueueing-scripts-only-if-not-in-queue-already/)
 * Hi, I am developing a plugin which uses Fancybox jQuery plugin. For completeness,
   I am including the Fancybox script in the plugin package. However, I don’t want
   to load id from my plugin if it is already loaded by something else.
 * Effectively, I want to make sure that Fancybox isn’t added multiple times.
 * Is there a way that I can find out what scripts are already in the script queue(
   from wp_enqueue_script) in order to prevent loading the script multiple times?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Anonymous User
 * (@anonymized-3085)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/enqueueing-scripts-only-if-not-in-queue-already/#post-1458880)
 * if it has been loaded via wp_enqueue_script then it will only get loaded once–
   even if added multiple times.
 *  Thread Starter [voidtrance](https://wordpress.org/support/users/voidtrance/)
 * (@voidtrance)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/enqueueing-scripts-only-if-not-in-queue-already/#post-1459019)
 * I am not entirely sure that is true. If two different plugins load the Fancybox
   jQuery javascript file but they give it different tags (argument 1 to wp_enqueue_script),
   how would wp_enqueue_script know that it is the same thing?
 * Of course, I as type this, I am realizing that there really isn’t a way to have
   a fool-proof way to get what I want done.
 * I am trying to get around the fact that the Fancybox for WordPress plugin and
   my plugin include two different version of the Fancybox javascript which conflict
   with each other.
 *  Anonymous User
 * (@anonymized-3085)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/enqueueing-scripts-only-if-not-in-queue-already/#post-1459044)
 * test it… probably the only way you will know for sure.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Enqueueing scripts only if not in queue already’ is closed to new replies.

## Tags

 * [wp_enqueue_script](https://wordpress.org/support/topic-tag/wp_enqueue_script/)

 * 3 replies
 * 2 participants
 * Last reply from: Anonymous User
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/enqueueing-scripts-only-if-not-in-queue-already/#post-1459044)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
