LLMS_Assets::get_defaults( string $type )

Retrieves an array of definition values based on asset type.


Parameters Parameters

$type

(string) (Required) The asset type. Accepts either "script" or "style".


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/class-llms-assets.php

	 * @return array
	 */
	protected function get_defaults( $type ) {

		$type_defaults = isset( $this->defaults[ $type ] ) ? $this->defaults[ $type ] : array();
		$defaults      = array_merge( $this->defaults['base'], $type_defaults );

		/**
		 * Filter the default values used to register or enqueue an asset
		 *
		 * The dynamic portion of this filter, `{$type}`, refers to the asset type. Either "script" or "style".
		 *
		 * @since 4.4.0
		 *
		 * @param array  $defaults   Default definition values.
		 * @param string $package_id An ID used to identify the originating plugin or theme that defined the asset.
		 */
		return apply_filters( "llms_get_{$type}_asset_defaults", $defaults, $this->package_id );


Top ↑

Changelog Changelog

Changelog
Version Description
4.4.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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