How to enqueue the script without hardcoded in the theme files?
//add the JS code in a variable – without <script> $script = ” jQuery(document).ready(function(){ // add your shortcode attribute and its default value to the // gallery settings list; $.extend should work as well… _.extend(wp.media.gallery.defaults, { type: ‘default_val’ }); // join default gallery settings template with yours — store in list if (!wp.media.gallery.templates) wp.media.gallery.templates = … Read more