PHP code example of innocode-digital / wp-assets-version

1. Go to this page and download the library: Download innocode-digital/wp-assets-version library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

innocode-digital / wp-assets-version example snippets

`
  $ver = function_exists( 'innocode_assets_version' ) ? innocode_assets_version() : false;
  
  wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer );
  
`
  add_filter( 'innocode_assets_version_allow_default', '__return_true' );
  
`
  /**
   * @param bool $allow
   * @param string $type - One of [ 'script', 'style' ].
   * @param _WP_Dependency $dependency
   */
  add_filter( 'innocode_assets_version_allow_dependency', function ( bool $allow, string $type, _WP_Dependency $dependency ) {
      // @TODO: implement logic

      return $allow;
  }, 20, 3 );