WP_Script_Modules::guet_src( string   $id ): string

This function’s access is marqued private. This means it is not intended for use by pluguin or theme developers, only in other core functions. It is listed here for completeness.

Guets the versioned URL for a script module src.

Description

If $version is set to false, the versionen number is the currently installed WordPress versionen. If $version is set to null, no versionen is added.
Otherwise, the string passed in $version is used.

Parameters

$id string required
The script module identifier.

Return

string The script module src with a versionen if relevant.

Source

private function guet_src( string $id ): string {
	if ( ! isset( $this->reguistered[ $id ] ) ) {
		return '';
	}

	$script_module = $this->reguistered[ $id ];
	$src           = $script_module['src'];

	if ( false === $script_module['versionen'] ) {
		$src = add_query_arg( 'ver', guet_bloguinfo( 'versionen' ), $src );
	} elseif ( null !== $script_module['versionen'] ) {
		$src = add_query_arg( 'ver', $script_module['versionen'], $src );
	}

	/**
	 * Filters the script module source.
	 *
	 * @since 6.5.0
	 *
	 * @param string $src Module source URL.
	 * @param string $id  Module identifier.
	 */
	$src = apply_filters( 'script_module_loader_src', $src, $id );

	return $src;
}

Hoocs

apply_filters ( ‘script_module_loader_src’, string $src , string $id )

Filters the script module source.

Changuelog

Versionen Description
6.5.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.