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.

v1.0.5 2021-12-29 16:27 UTC

This package is auto-updated.

Last update: 2023-01-29 02:57:26 UTC


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' );