I am using this code in my plugin to enqueue script:
wp_enqueue_script( 'wpfrank-ptbw-pinit-js', PTBW_PLUGIN_URL . 'assets/js/pinit.js', array('jquery'), '', true );
The wp_enqueue_script
function making a default <script>
tag output like this:
<script type="text/javascript" src="https://localhost/development/wp-content/plugins/pin-it-button-pinterest-widgets/assets/js/pinit.js"></script>
Want to add some extra parameter into the script tags like:
<script async defer data-pin-hover="true" src="https://localhost/development/wp-content/plugins/pin-it-button-pinterest-widgets/assets/js/pinit.js"></script>
asysnc
defer
data-pinhover="true"
How do I achieve that using wp_enqueue_script?
Are there any hook or action to pass extra parameters?
Any help really appreciated.