assets.php
Helper functions that retrieve front-end assets (css,js,images).
Tags
Table of Contents
- get_asset_path() : string
- Determine the actual location of an asset.
- get_script_path() : string|null
Functions
get_asset_path()
Determine the actual location of an asset.
get_asset_path(string $name[, string $type = 'script' ][, string $plugin_slug = 'wallets' ]) : string
Autodetects which plugin it was called from. Gives priority to minified, versioned files. This way, if you delete the minified file, the plugin falls back to the unminified asset.
Parameters
- $name : string
-
Base name of asset.
- $type : string = 'script'
-
One of script, style, sprite.
- $plugin_slug : string = 'wallets'
-
The plugin's slug. For this plugin, this is "wallets".
Tags
Return values
string —The path to the asset, relative to wordpress base dir.
get_script_path()
get_script_path(string $name) : string|null
Parameters
- $name : string