WPSEO_Admin_Asset_Dev_Server_Location::get_url()publicYoast 1.0

Determines the URL of the asset on the dev server.

Метод класса: WPSEO_Admin_Asset_Dev_Server_Location{}

Хуков нет.

Возвращает

Строку. The URL of the asset.

Использование

$WPSEO_Admin_Asset_Dev_Server_Location = new WPSEO_Admin_Asset_Dev_Server_Location();
$WPSEO_Admin_Asset_Dev_Server_Location->get_url( $asset, $type );
$asset(WPSEO_Admin_Asset) (обязательный)
The asset to determine the URL for.
$type(строка) (обязательный)
The type of asset. Usually JS or CSS.

Код WPSEO_Admin_Asset_Dev_Server_Location::get_url() Yoast 22.4

public function get_url( WPSEO_Admin_Asset $asset, $type ) {
	if ( $type === WPSEO_Admin_Asset::TYPE_CSS ) {
		return $this->get_default_url( $asset, $type );
	}

	$path = sprintf( 'js/dist/%s%s.js', $asset->get_src(), $asset->get_suffix() );

	return trailingslashit( $this->url ) . $path;
}