Register scripts

Home » Snippets » Register scripts
0

Created with:

Register Script Generator

Visibility: 

public

Creator: Julien

Customize with WPTurbo AI
X

Add Snippet To Project

New Project
Add To Existing Project
				/**
 * Registers a custom script to be used on the front-end of the website.
 *
 * @return void
 */
function wpturbo_register_my_custom_scripts() : void {
	wp_register_script( 'my-script', get_template_directory_uri() . 'my-script.js', [], false );
	wp_enqueue_script( 'my-script' );
}
add_action( 'wp_enqueue_scripts', 'wpturbo_register_my_custom_scripts' );
			

Register an account to save your snippets or go Pro to get more features.