wp_register_script [ WordPress Function ]
wp_register_script ( $handle, $src, $deps = array(), $ver = false, $in_footer = false )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: wp_deregister_script, wp_register_style, wp_deregister_style, wp_register, wp_print_scripts
Register new Javascript file.
Source
<?php
function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) {
global $wp_scripts;
if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
if ( ! did_action( 'init' ) )
_doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
'<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
$wp_scripts = new WP_Scripts();
}
$wp_scripts->add( $handle, $src, $deps, $ver );
if ( $in_footer )
$wp_scripts->add_data( $handle, 'group', 1 );
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/wp register script « WordPress Codex
<?php wp_register_script( $handle, $src, $deps, $ver, $in_footer ); ?> Use the wp_enqueue_scripts action to call this function, or admin_enqueue_scripts to call ...
codex.wordpress.org - Function Reference/wp enqueue script « WordPress Codex
wp_register_script( 'my-plugin-script', plugins_url('/script.js', __FILE__) ); } function my_plugin_admin_menu() { /* Register our plugin page */ $page ...
codex.wordpress.org - wp_register_script - Big Red Tin
Jun 4, 2010 ... In Part 1 we introduced the wp_register_script and wp_enqueue_script functions developed to avoid JavaScript conflicts. In this section we'll ...
bigredtin.com - php - WordPress wp_register_script function not loading script in ...
I am trying to load JQuery hosted on Google in my blog's footer just ... I suspect that one of the other scripts that is dependent on jquery is not set ...
stackoverflow.com
Kullanýcý Tartýþmalarý [ wordpress.org ]
- RavanH on "Script handle naming convention"
- lifeofguenter on "wp_register_script - & char is converted and breaks code"
- ryanve on "Get info for enqueued scripts?"
- danbo on "Ajax Event Calendar conflict with Easy FancyBox"
- danbo on "Ajax Event Calendar conflict with Easy FancyBox"
- Eran Miller on "Ajax Event Calendar conflict with Easy FancyBox"
- RavanH on "Ajax Event Calendar conflict with Easy FancyBox"
- Eran Miller on "Ajax Event Calendar conflict with Easy FancyBox"
- Eran Miller on "Ajax Event Calendar conflict with Easy FancyBox"
- RavanH on "Script handle naming convention"