Tag Info

Hot answers tagged

4

From your comment above I read This is one of the reason why i am looking for a way to say to wordpress: "hey, i added those js files, dont worry". This is whole purpose of this question I think is perfectly fair, I +1ed your Q but the problem is that way does not exists, or better does not exists a clean, canonical way. How To first of all you ...


1

The jQuery library packed with WordPress, operates under noConflict mode. Means you can not use $ in your jQuery snippet/code. Either use jQuery instead of $. or use noConflict wrapper like this. <script type="text/javascript"> <!-- jQuery(document).ready(function($) { // your jquery function, you can use $ here. }); // ...


1

You should solve your problem while moving toward a best practice while you're at it by using wp_enqueue_script(). This will likely solve your issues because it's domain agnostic. Start by moving your JS file(s) to a /js/ folder in your [child] theme or custom plugin. Then load your script like this... (snippets copied and adpated from Codex page). Theme ...


1

I think you're looking for gform_enqueue_scripts which is simply a Gravity Forms specific version of the wp_enqueue_scripts hook. Either hook uses the wp_enqueue_script() function. That function can take a local script—usually using get_template_directory_uri() (theme), get_stylesheet_directory_uri() child theme), or plugins_url() (plugin) to reference the ...


1

I found the solution to my problem was to change my_data.data.my_key to my_data.my_key. For example: $( document ).on( 'click', '#button', function() { var my_data = wp.heartbeat.getQueuedItem( 'my_handle' ); alert( my_data.my_key ); }); The queued data can be easily accessed now.


1

Depending on how your Galleria plugin is interacting with the attachment image filters, you should be able to inject your data attribute using the wp_get_attachment_image_attributes filter. Obviously, the attribute would be added for anything using wp_get_attachment_image(), but it will do what you're asking. /** * Filter attributes for the current ...


1

In my honest opinion, I would not do that. PRO'S and CON's PRO'S There are really not any pro's here, except for having a couple of files fewer. I don't even think that you are going to gain any significant load time at all combining these files CON'S There are many concerns here You should not make direct changes to buddypress files. You will loose ...


1

Why don't you just de-Register those handles to 6 different files, and re-register those handles to one combined file? I think if you have 6 different handles, pointing to one file, WordPress will enque this file just once. So you can guarantee that your dependencies dont break up. Is this an possible solution for you?



Only top voted, non community-wiki answers of a minimum length are eligible