Articles of wp register script

Where does WordPress register default scripts like jQuery?

I’m figuring out the ins and outs of WordPress. I know that WordPress sets some default filters and actions in /wp-includes/default-filters.php, but where does it register its scripts like jQuery? We are all able to set jQuery as a dependency or just enqueue it in our themes, but where does WordPress register it? Any help […]

WP .js script file not loading

I have looked all over the place and did not find a solution to my problem. I have a child theme where I have a functions.php file where I try to register and enqueue the script the following way: function wpb_adding_scripts() { wp_register_script(‘my_scripts’, get_stylesheet_directory_uri(‘js/scripts.js’, __FILE__), array(‘jquery’),’1.1′, true); wp_enqueue_script(‘my_scripts’); } add_action( ‘wp_enqueue_scripts’, ‘wpb_adding_scripts’ ); And here […]

Best spot for wp_register_script() and wp_register_style()

I need to enqueue multiple scripts and styles in my plugin. However, I do not like the idea of calling wp_register_script() and wp_register_style() every time I need to call wp_enqueue_script() and wp_enqueue_style(). I think it is a good idea to register the scripts and styles once, then call them as necessary as needed. So my […]

After e-junkie payment, send a http post to register user automatically?

I have the workflow thought out: User pays for something on your site using e-junkie. After payment, a http post ( with user email and name gets sent to a wordpress registration script ) and registers that user automatically — ignores if the email is in database I think we can use the wp-register.php page […]

plugins_url function mixes system path and URL

In my WordPress widget I use the following code: wp_register_script(‘jquery-ui.widget’, plugins_url(‘assets/js/jquery-ui-1.9.2.widget.js’, dirname( __FILE__ ))); Unfortunately, the code gives me an invalid URL which is mixed with my system path: http://test.dev/wp-content/plugins/C:/projects/wordpress/plugins/assets/js/jquery-ui-1.9.2.widget.js?ver=3.6 Is this problem maybe related to the fact that I have a local WordPress installation running on a Windows computer (with Apache 2)?

Including style.css in Child Theme

Twenty Thirteen uses wp_enqueue_style( ‘twentythirteen-style’, get_stylesheet_uri() ); in functions.php. Wheter I use it or not use it in twentythirteen-child/functions.php the style.css from Child Theme is loaded (it is always loaded) and style.css from parent theme can never be loaded. This is an exception to other files added via wp_enqueue_style(), right? It doesn’t behave like all […]

getting a js file for one page

wp_register_script(‘SliderViewer’, ‘/js/SliderViewer-1.2.js’); wp_enqueue_script(‘SliderViewer’); get_header(); however, mydomain.com/js/SliderViewer-1.2.js doesn’t exist. My js is in the ftp at thewebsite -> wp-content -> themes -> BLANK-Theme -> js What’s the path of that? Thanks-

WP deregister, register and enqueue dequeue

a plugin that I bought is loading a few js and css files on all pages, so I wanted to write a new function to deregister the handles, and enqueu them where I wanted. however I am not sure If I have to deregister => register and then enqueue. or do I just dequeue them […]

How to cancel `wp_print_scripts`?

I want to load all the scripts in $wp_scripts with my own JS function after the window.onload event. Is there a simple way to prevent wp_print_scripts from printing the default list of <script> tags so I can replace it with my own code?

Modernizr check first, then move on to wp_register_script()/wp_enqueue_script

I’ve been playing with Modernizr in WordPress lately and here’s something that i’m trying to achive. I’m adding an HTML5 input field in a custom options page, specifically: <input type=”number” /> Now with Modernizr i can test if the browser supports it like this: Modernizr.load([ { test: Modernizr.inputtypes.number, // this is the test nope: [ […]