As of WordPress 6.3, the in_footer
parameter is now bundled into the args
array parameter (source).
The correct syntax for the wp_enqueue_script()
function is now as follows (leaving out the named function parameter as it not officially supported by WP core):
wp_enqueue_script( string $handle, string $src="", string[] $deps = array(), string|bool|null $ver = false, array|bool $args = array() )
In your case, you would write your function as follows:
$args = array(
'in_footer' => 'true'
);
wp_enqueue_script('swiper-script', 'https://unpkg.com/swiper@8/swiper-bundle.min.js', [], false, $args);
Your revised wp_enqueue_script()
function you now rely on works because there is still backwards compatibility for the in_footer
parameter as @Howdy_McGee points out, (see here), but only if you’re not specifying in_footer: true
and instead just true
since the parameter is removed from the function declaration.