kirki-framework / url-getter
Helper component to get the URL of a file in WordPress.
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 9 624
Dependents: 41
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 1
Requires
- php: >=7.0
README
This is a simple component to get the URL of files in WordPress.
It was originally built for the Kirki Framework but can be used in any WordPress plugin or theme.
Since the Kirki Framework can be installed as a plugin, included in themes, or even included in other plugins, I needed a simple and effective way to get the URL of any file using its path as a reference. This way the scripts and styles for the customizer controls that Kirki contains can be loaded without issues in most cases.
To install using Composer:
composer install kirki-framework/url-getter
Then when you need to get the URL of a file you can do this:
$url = \Kirki\URL::get_from_path( '/absolute/path/to/file' );