LLMS_Assets::prepare_inline_asset_for_output( array $asset, string $location )
Prepares an inline asset definition for being output.
Description Description
When $this->debugging_assets
is true
this will add line breaks between each inline asset and output the asset’s handle as a comment before the asset’s script/style so that the inline assets can be quickly located and reviewed in the generated source of the page.
Parameters Parameters
- $asset
-
(array) (Required) The inline asset definition array.
- $location
-
(string) (Required) The location of the asset. Accepts "header", "footer", or "style".
Return Return
(string)
Source Source
File: includes/class-llms-assets.php
* @return string */ protected function prepare_inline_asset_for_output( $asset, $location ) { $before = ''; $after = ''; // Output inline asset handles and add line breaks when debugging. if ( $this->debugging_assets ) { // Setup the comment template. $before = 'style' === $location ? '/* %s. */' : '// %s.'; // Add line breaks. $before .= "\n"; $after = "\n"; } return sprintf( $before, $asset['handle'] ) . $asset['asset'] . $after;
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |