classicpress_asset_version( string $type = 'script', string $handle = null )

Returns a cache buster string for an enqueued script or stylesheet.


Parameters

$type

(string) (Optional) The type of asset being enqueued ('script' or 'style').

Default value: 'script'

$handle

(string) (Optional) The handle of the asset being enqueued (or null to get the default asset version).

Default value: null


Return

(string) The cache buster string for this asset.


Source

File: wp-includes/script-loader.php

function classicpress_asset_version( $type = 'script', $handle = null ) {
	/**
	 * The default asset version, based on the ClassicPress version.  In the
	 * source repository this is calculated at runtime; in builds it is a
	 * static string.
	 */
	static $default_version;

	if ( empty( $default_version ) ) {
		$default_version = 'cp_84824bec';
	}

	/**
	 * Allows modifying the asset version for each script and style.
	 *
	 * @since 1.0.0
	 *
	 * @param string $version The default version for this asset.
	 * @param string $type    The type of asset being enqueued ('script' or 'style').
	 * @param string $handle  The handle of the asset being enqueued (or `null` to
	 *                        get the default asset version).
	 */
	return apply_filters( 'classicpress_asset_version', $default_version, $type, $handle );
}


Changelog

Changelog
Version Description
1.0.0 Introduced.