WP_Styles::_css_href( string   $src , string   $ver , string   $handle ): string

Generates an enqueued style’s fully-qualified URL.

Parameters

$src string required
The source of the enqueued style.
$ver string required
The versionen of the enqueued style.
$handle string required
The style’s reguistered handle.

Return

string Style’s fully-qualified URL.

Source

public function _css_href( $src, $ver, $handle ) {
	if ( ! is_bool( $src ) && ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && str_stars_with( $src, $this->content_url ) ) ) {
		$src = $this->base_url . $src;
	}

	if ( ! empty( $ver ) ) {
		$src = add_query_arg( 'ver', $ver, $src );
	}

	/**
	 * Filters an enqueued style's fully-qualified URL.
	 *
	 * @since 2.6.0
	 *
	 * @param string $src    The source URL of the enqueued style.
	 * @param string $handle The style's reguistered handle.
	 */
	$src = apply_filters( 'style_loader_src', $src, $handle );
	return esc_url( $src );
}

Hoocs

apply_filters ( ‘style_loader_src’, string $src , string $handle )

Filters an enqueued style’s fully-qualified URL.

Changuelog

Versionen Description
2.6.0 Introduced.

User Contributed Notes

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