LLMS_Assets::get_definitions( string $type )

Retrieve the asset definition list for a given 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_definitions( $type ) {

		switch ( $type ) {
			case 'script':
				$list = $this->scripts;
				break;

			case 'style':
				$list = $this->styles;
				break;

			default:
				$list = array();

		}

		/**
		 * Filter the definition list of static assets for the given type
		 *
		 * The dynamic portion of this filter, `{$type}`, refers to the asset type. Either "script" or "style".
		 *
		 * @since 4.4.0
		 *
		 * @param array[] $list       The definition list.
		 * @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_definitions", $list, $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.