DeliverAnonymousAsset
in package
Deliver anonymous assets through `wp-content/uploads`.
Table of Contents
Properties
- $builder : AnonymousAssetBuilder
- Builder.
- $file : mixed
- $handle : mixed
Methods
- __construct() : mixed
- C'tor.
- attribute_escape() : mixed
- Modify CData script tag.
- ready() : mixed
- The handle is enqueued, let's modify the `WP_Dependency`.
- script_loader_tag() : mixed
- Modify tags to now show any `id` attribute.
- wp_inline_script_attributes() : array<string, string|bool>
- Remove `id` from inline script attributes for the base and localize resource handles.
- generateSrc() : mixed
- Generate the file in our content directory and return the URL.
Properties
$builder
Builder.
private
AnonymousAssetBuilder
$builder
$file
private
mixed
$file
$handle
private
mixed
$handle
Methods
__construct()
C'tor.
public
__construct(AnonymousAssetBuilder $builder, string $handle, string $file) : mixed
Parameters
- $builder : AnonymousAssetBuilder
- $handle : string
- $file : string
Tags
attribute_escape()
Modify CData script tag.
public
attribute_escape(string $safe_text) : mixed
Parameters
- $safe_text : string
-
The text after it has been escaped.
ready()
The handle is enqueued, let's modify the `WP_Dependency`.
public
ready() : mixed
script_loader_tag()
Modify tags to now show any `id` attribute.
public
script_loader_tag(string $tag, string $handle) : mixed
Parameters
- $tag : string
-
The
<script>tag for the enqueued script. - $handle : string
-
The script's registered handle.
wp_inline_script_attributes()
Remove `id` from inline script attributes for the base and localize resource handles.
public
wp_inline_script_attributes(array<string, string|bool> $attributes) : array<string, string|bool>
Parameters
- $attributes : array<string, string|bool>
Return values
array<string, string|bool>generateSrc()
Generate the file in our content directory and return the URL.
protected
generateSrc() : mixed