Revisioning CSS/JS appending a hash in you assets of wordpress theme
JavaScript PHP CSS
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
.editorconfig
.gitattributes
.gitignore
.jshintrc
.npmignore
.travis.yml
LICENSE
README.md
index.js
package.json
test.js

README.md

gulp-wp-rev

gulp-wp-rev plugin for gulp

Revisioning CSS/JS appending a hash in you assets of wordpress theme.

styles.css?ver=1styles.css?ver=bd0622b828f9346876088cd617566fa5

demo

Usage

First, install gulp-wp-rev as a development dependency:

npm install --save-dev gulp-wp-rev

Then, add it to your gulpfile.js:

var wpRev = require('gulp-wp-rev');

gulp.task('rev', function() {
    gulp.src('./wp-content/themes/raulghm-theme/lib/scripts.php')
    .pipe(wpRev({
        css: 'src/styles/styles.css',
        cssHandle: 'my_assets',
        js: 'src/scripts/scripts.js',
        jsHandle: 'my_assets'
    }))
    .pipe(gulp.dest('./wp-content/themes/raulghm-theme/lib'));
});

API

wp-rev(options)

options.css

Type: String

css source file

options.js

Type: String

js source file

options.cssHandle

Type: String

Name used as a handle for the stylesheet.

options.jsHandle

Type: String

Name used as a handle for the javascript.

License

MIT © raulghm