: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* @param string $script_id
public function async_script_tag( $script_id ) {
function( $tag, $handle, $src ) use ( $script_id ) {
// check against our registered script handle
if ( $script_id === $handle ) {
if ( strpos( $tag, 'async' ) === false ) {
// add attributes of your choice
$tag = str_replace( '<script ', '<script async=\'async\' ', $tag );
31, // async for WordPress plugin uses 20