Download the PHP package innocode-digital/wp-assets-version without Composer
On this page you can find all versions of the php package innocode-digital/wp-assets-version. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download innocode-digital/wp-assets-version
More information about innocode-digital/wp-assets-version
Files in innocode-digital/wp-assets-version
Package wp-assets-version
Short Description Helps with versioning of CSS and JS files.
License GPL-2.0+
Informations about the package wp-assets-version
Assets Version
Description
Helps with versioning of CSS and JS files. Plugin adds flush buttons to admin area for version upgrading. Requires Flush Cache Buttons plugin.
Install
-
Preferable way is to use Composer:
`
By default, it will be installed as Must Use Plugin. It's possible to control with
extra.installer-paths
incomposer.json
. -
Alternate way is to clone this repo to
wp-content/mu-plugins/
orwp-content/plugins/
:`
If plugin was installed as regular plugin then activate Assets Version from Plugins page
or WP-CLI: wp plugin activate wp-assets-version
.
Usage
There are known functions wp_enqueue_script and
wp_enqueue_style in WordPress core to register
and enqueue scripts and styles. In both of them 4th parameter
is for version number and in ideal case it should be version of build or theme or null
with some version hash in filename ...
but sometimes it's hard to implement or there are could be particular issues in caching, and it's where this plugin becomes
as a good hotfix. There are few ways to add version with this plugin:
-
Retrieve version through function
innocode_assets_version()
and set as 4th parameter in enqueue functions, e.g.:`
-
Force using of version where
null
set as 4th parameter:`
-
Force using of version but with own logic per dependency (requires previous hook to be set), e.g.:
`
All versions of wp-assets-version with dependencies
composer/installers Version ~1.0
innocode-digital/wp-version Version ^1.0