add_action('print_media_templates', function(){ ?> <script type="text/html" id="tmpl-my-custom-gallery-setting"> <span class="setting"> <label for="gallery-settings-preview" class="name">游客预览数</label> <input type="text" id="gallery-settings-preview" name="preview" data-setting="preview" style="float: left;width: 100px" /> </span> </script> <script> jQuery(document).ready(function(){ _.extend(wp.media.gallery.defaults, { preview: '' }); wp.media.view.Settings.Gallery = wp.media.view.Settings.Gallery.extend({ template: function(view){ return wp.media.template('gallery-settings')(view) + wp.media.template('my-custom-gallery-setting')(view); } }); }); </script> <?php });
当然,还可以增加仅限VIP查看,可配合erphpdown插件来实现~
声明:本站所有源码尽量保证原汁原味,如有特殊情况会作出声明及标注,网站资源不做任何二次加密(原版加密除外,不影响程序使用的不会做解密处理),方便您更好的学习参考。 在您的能力范围内,为了大环境的良性发展,请尽可能的选择正版资源。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。