wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema
wp_register_script › WordPress Function
Desde2.1.0
Obsoleton/a
› wp_register_script ( $handle, $src, $deps = array(), $ver = false, $args = array() )
Parâmetros: (5) |
|
Ver: |
|
Retorna: |
|
Definido em: |
|
Codex: | |
Log de mudanças: |
|
Registers a new script.
Registers a script to be enqueued later using the wp_enqueue_script() function.Funções relacionadas: wp_deregister_script, wp_register_script_module, wp_deregister_script_module, wp_register_style, wp_register_tinymce_scripts
Fonte
function wp_register_script( $handle, $src, $deps = array(), $ver = false, $args = array() ) { if ( ! is_array( $args ) ) { $args = array( 'in_footer' => (bool) $args, ); } _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle ); $wp_scripts = wp_scripts(); $registered = $wp_scripts->add( $handle, $src, $deps, $ver ); if ( ! empty( $args['in_footer'] ) ) { $wp_scripts->add_data( $handle, 'group', 1 ); } if ( ! empty( $args['strategy'] ) ) { $wp_scripts->add_data( $handle, 'strategy', $args['strategy'] ); } return $registered; }