diff --git a/composer.lock b/composer.lock index 66d6820..dd3f649 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7c63b249619cabe238ad1272b21557ab", + "content-hash": "97aa6e0d7cea740f5c6a97ab3f843895", "packages": [], "packages-dev": [ { @@ -258,16 +258,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.1", + "version": "3.7.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", "shasum": "" }, "require": { @@ -303,14 +303,15 @@ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", - "standards" + "standards", + "static analysis" ], "support": { "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2022-06-18T07:21:10+00:00" + "time": "2023-02-22T23:07:41+00:00" }, { "name": "wp-coding-standards/wpcs", @@ -373,5 +374,5 @@ "php": ">=7.3" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } diff --git a/src/Loader_Trait.php b/src/Loader_Trait.php new file mode 100644 index 0000000..eb2c88a --- /dev/null +++ b/src/Loader_Trait.php @@ -0,0 +1,55 @@ +register_namespace( $this->namespace, $assets ); + } + ); + } + + /** + * Get the cache buster asset path + * + * @param string $asset Asset path. + * @return string Asset path with cache buster. + */ + public function asset_path( $asset ) { + return Asset_Loader::get_instance()->get_path( $this->namespace, $asset ); + } + + /** + * Get the cache buster asset uri + * + * @param string $asset Asset uri. + * @return string Asset uri with cache buster. + */ + public function asset_uri( $asset ) { + return Asset_Loader::get_instance()->get_uri( $this->namespace, $asset ); + } +}