You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|filePath|string|`''`|x|x|x|optional path which can be set to autodiscover the Asset version|
27
-
|dependencies|array|`[]`|x|x|x|all defined depending handles|
28
-
|location|int| falls back to `Asset::FRONTEND`|x|x|x|depending on location of the `Asset`, it will be enqueued with different hooks|
29
-
|version|string|`null`|x|x|x|version of the given asset|
30
-
|enqueue|bool/callable|`true`|x|x|x|is the asset only registered or also enqueued|
31
-
|data|array/callable|`[]`|x||x|additional data assigned to the asset via `WP_Script::add_data` or `WP_Style::add_data`|
32
-
|filters|callable[]|`[]`|x||x|an array of `Inpsyde\Assets\OutputFilter` or callable values to manipulate the output|
33
-
|handler|string|`ScriptHandler::class`, `StyleHandler::class`, `ScriptModuleHandler::class`|x|x|x|The handler which will be used to register/enqueue the Asset|
34
-
|attributes|array|`[]`|x||x|Allows to set additional attributes to the `script`- or `link`-tag|
35
-
|media|string|`'all'`|||x|type of media for the `Style`|
36
-
|localize|array|`[]`|x|||localized array of data attached to `Script`|
37
-
|inFooter|bool|`true`|x|||defines if the current `Script` is printed in footer|
38
-
|inline|array|`[]`|x|||allows you to add inline scripts to `Script`-class via `['before' => [], 'after' => []]`|
39
-
|translation|array|`[]`|x|||Load translation for `Script`-class via `['path' => string, 'domain' => string]`|
|filePath|string|`''`| x | x | x |optional path which can be set to autodiscover the Asset version|
27
+
|dependencies|array|`[]`| x | x | x |all defined depending handles|
28
+
|location|int| falls back to `Asset::FRONTEND`| x | x | x |depending on location of the `Asset`, it will be enqueued with different hooks|
29
+
|version|string|`null`| x | x | x |version of the given asset|
30
+
|enqueue|bool/callable|`true`| x | x | x |is the asset only registered or also enqueued|
31
+
|data|array/callable|`[]`| x || x |additional data assigned to the asset via `WP_Script::add_data` or `WP_Style::add_data`|
32
+
|filters|callable[]|`[]`| x || x |an array of `Inpsyde\Assets\OutputFilter` or callable values to manipulate the output|
33
+
|handler|string|`ScriptHandler::class`, `StyleHandler::class`, `ScriptModuleHandler::class`| x | x | x |The handler which will be used to register/enqueue the Asset|
34
+
|attributes|array|`[]`| x || x |Allows to set additional attributes to the `script`- or `link`-tag|
35
+
|media|string|`'all'`||| x |type of media for the `Style`|
36
+
|localize|array|`[]`| x |||localized array of data attached to `Script`|
37
+
|inFooter|bool|`true`| x |||defines if the current `Script` is printed in footer|
38
+
|inline|array|`[]`| x |||allows you to add inline scripts to `Script`-class via `['before' => [], 'after' => []]`|
39
+
|translation|array|`[]`| x |||Load translation for `Script`-class via `['path' => string, 'domain' => string]`|
Copy file name to clipboardExpand all lines: docs/getting-started.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,3 +28,55 @@ add_action(
28
28
}
29
29
);
30
30
```
31
+
32
+
# Extending Assets
33
+
34
+
In some cases, when loading multiple Assets through a Loader like `Inpsyde\Assets\Loader\WebpackManifestLoader`, you will have the need to also extend one or multiple Assets loaded.
35
+
Since the output of the `manifest.json` is fixed, we're limited with the Loader. In this case, we can make use of the `AssetManager::extendAsset()` method, which will allow us to add additional data to an Asset _before_ it is processed.
> :information_source:**Via `array $extension`, you cannot change the `type` and `handle` and `url` of the Asset. Have a closer look into [Assets](./assets.md) documentation about the "Configuration API".**
0 commit comments