WordPress Plugin Authoring question about jquery and css

One point for using wp_enqueue_script is for that very reason. Never assume anything, enqueue jQuery so that if it is there already it does nothing, but if not , it will queue it up. If your talking about the image path for your plugin, you can use the following, http://codex.wordpress.org/Determining_Plugin_and_Content_Directories The examples for plugins_url should … Read more

wordpress enqueue script not working

You only register your first script, but don’t enqueue it. Change wp_register_script to wp_enqueue_script and it should work. Registering it is useful if you may possibly enqueue it at different times/conditions, but in this case you can just enqueue it straight away.

Fatal error: allowed memory size when after using enqueue_script

The problem is the de-registering the core-bundled version of jQuery, and re-registering using your own, arbitrary version. Do not de-register core-bundled versions of scripts (especially jQuery) in order to register arbitrary/custom versions of those scripts. Doing so can and will cause breakage and unintended consequences. If you’re doing so in order to cause your custom … Read more

Dynamic wp_enqueue_scripts?

You could use anonymous functions in PHP 5.3+ to do this. <?php function addThemeJS($enqueueThemeJS, $handle, $src, $deps, $ver, $in_footer) { add_action(‘wp_enqueue_scripts’, function() use ($handle, $src, $deps, $ver, $in_footer) { wp_enqueue_script($handle, $src, $deps, $ver, $in_footer); }); } If you’re using this a personal project where you know the server has 5.3+ you would be okay if … Read more