WP_Styles::_css_href

Advertisement

Summery Summery

Generates an enqueued style’s fully-qualified URL.

Syntax Syntax

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

Parameters Parameters

$src

(Required) The source of the enqueued style.

$ver

(Required) The version of the enqueued style.

$handle

(Required) The style's registered handle.

Return Return

(string) Style's fully-qualified URL.

Source Source

File: wp-includes/class.wp-styles.php

	 * @param string $handle The style's registered handle.
	 * @return string Style's fully-qualified URL.
	 */
	public function _css_href( $src, $ver, $handle ) {
		if ( ! is_bool( $src ) && ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && 0 === strpos( $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 registered handle.
		 */

Advertisement

Changelog Changelog

Changelog
Version Description
2.6.0 Introduced.

Advertisement

Leave a Reply