This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Reply To: replacing prettyphoto, other scripts…

#1885
Jason Bobich
Keymaster

I do find this idea intriguing. I’ve started a ticket in our repository and will look into it a little more. Just some thoughts about this. —

The problem is that in order to do this, you wouldn’t be able to have the javascript utilizing these jQuery plugins in themeblvd.js or in any enqueue’d script in quite the same way. So, we’d be effectively somewhat abandoning WordPress’s system for scripts and creating our own system.

You’d need to have this javascript be spit out inline in some function attached to wp_head or something similar to that. Yes, some plugins do this, but I don’t believe this is the right approach. Because when you do this, your javascript code is no longer being enqueue’d within the WordPress system.

Now, contrary to what I said above, an alternate approach that the framework could accomplish what you’re suggesting with still enque’ing a file would be to register locals within the PHP that have true/false booleans for our different plugins and check for them in the themeblvd.js (for example). This is the only way I know to really pass on the functionality of PHP elements through to static javascript files within the limitations of WordPress. However, then when someone wants to edit themeblvd.js in the traditional way, it’s now going to be a little more confusing of a file. Also, we’ll now have a few extra PHP processes happening along with a little bit of extra javascript to register these locals and check against them.

So, I’m not quite sure how to handle what you’re suggesting without causing other issues or making other things more confusing. With a framework like this, there are just so many scripts coming into play, and I’m just trying to keep them as tight to the WordPress-intended system as possible. But I will take a look at what you’re suggesting and see how this could possibly be incorporated within the global config filter and possibly not effect other things.