LLMS_Assets::get_definitions_inline( string $location )

Retrieve a list of inline asset definitions by location.


Parameters Parameters

$location

(string) (Required) Location of scripts to output. Accepts "style", "header", or "footer". Inline header styles are output using "style". Inline scripts are output using either "header" or "footer", output in their respective locations.


Top ↑

Return Return

(array[])


Top ↑

Source Source

File: includes/class-llms-assets.php

	 * @return array[]
	 */
	protected function get_definitions_inline( $location ) {

		$assets = array();

		foreach ( $this->inline as $handle => $definition ) {

			if ( $location === $definition['location'] ) {
				$assets[ $handle ] = $definition;
			}
		}

		// Sort by priority.
		uasort(
			$assets,
			function ( $a, $b ) {
				if ( $a['priority'] === $b['priority'] ) {
					return 0;
				}
				return $a['priority'] < $b['priority'] ? -1 : 1;
			}
		);

		return $assets;


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.