LLMS_Assets::enqueue_inline( string $handle, string $asset, string $location, int|float $priority = 10 )

Enqueue an inline script or style


Parameters Parameters

$handle

(string) (Required) Inline asset ID.

$asset

(string) (Required) The inline script or CSS rule. This should *not* be wrapped in <script> or <style> tags.

$location

(string) (Required) Output location of the inline asset. Accepts "style" (for stylesheets in the headr), "header" (for scripts in the header), or "footer" (for scripts in the footer).

$priority

(int|float) (Optional) Output priority of the inline asset.

Default value: 10


Top ↑

Return Return

(float) Returns the priority of the enqueued script


Top ↑

Source Source

File: includes/class-llms-assets.php

163
164
165
166
167
168
169
170
171
172
173
174
175
* @return float Returns the priority of the enqueued script
 */
public function enqueue_inline( $handle, $asset, $location, $priority = 10 ) {
 
    // If script already exists, remove it and re-enqueue.
    if ( $this->is_inline_enqueued( $handle ) ) {
        unset( $this->inline[ $handle ] );
    }
 
    $priority                = $this->get_inline_priority( $priority, $this->get_definitions_inline( $location ) );
    $this->inline[ $handle ] = compact( 'handle', 'asset', 'location', 'priority' );
 
    return $priority;


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.