Best Practice for checking if a common script from other plugins is registered? (1 post)

  1. datdesignguy
    Posted 3 years ago #

    Hi Guys and Gals,

    I'm building a plugin for a client using the Facebook Javascript SDK, hosted from the facebook servers. Facebook functionality in WordPress is super common, so I went ahead and downloaded the official facebook plugin, and added checks to my plugin to prevent the registration and queueing of the FB Javascript SDK from my plugin.

    I was wondering, is there a WP function to search the scripts registered/enqueued by url instead of handle? I've found wp_script_is but that seems to only be handy if you know the handle of the plugin registering the script.

    Obviously, not everyone is going to use the Facebook plugin for FB functionality, so there are tons of other potential plugins that may also end up registering the FB Javascript SDK alongside of mine. But if the JS is already going to be queued up, I don't want to risk conflicts by registering and queueing a second instance.

    Maybe I worry too much. IDK. Anyone have any good advice here?

Topic Closed

This topic has been closed to new replies.

About this Topic