I’m starting to use gulp with WordPress and right now try to implement gulp-wp-rev to revision my custom.min.css and custom.min.js files. In my gulpfile I configured the task like this:

gulp.task('rev', function() {
    css: './style.min.css',
    cssHandle: 'aa_style',
    js: './assets/js/custom.min.js',
    jsHandle: 'aa_customJs'

Works perfectly. The output in my functions.php for the js file looks like this:

wp_register_script('aa_customJs', get_template_directory_uri() . '/assets/js/custom.min.js', array( 'jquery' ), '45bd3f9d72e6a73702772fa39c6f673e', true ); // Custom scripts
wp_enqueue_script('aa_customJs'); // Enqueue it!

Well… but how can I add the version number to the original custom.min.js file with gulp-wp-rev? Any ideas? Thanks for your help!

Read more here: Using gulp-wp-rev to revision css/js files in my wordpress theme


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: