-
-
Save LeoLopesWeb/d8ded1000e545703c285a810a0a2f971 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Set up the new field in the media module. | |
| * | |
| * @return void | |
| */ | |
| function additional_gallery_settings() { | |
| ?> | |
| <script type="text/html" id="tmpl-custom-gallery-setting"> | |
| <span>Estilo</span> | |
| <select data-setting="style"> | |
| <option value="default-style">Padrão</option> | |
| <option value="carousel-style">Carrossel</option> | |
| <!-- <option value="ie7-style">IE7 Style</option> --> | |
| </select> | |
| </script> | |
| <script type="text/javascript"> | |
| jQuery( document ).ready( function() { | |
| _.extend( wp.media.gallery.defaults, { | |
| style: 'default-style' | |
| } ); | |
| wp.media.view.Settings.Gallery = wp.media.view.Settings.Gallery.extend( { | |
| template: function( view ) { | |
| return wp.media.template( 'gallery-settings' )( view ) | |
| + wp.media.template( 'custom-gallery-setting' )( view ); | |
| } | |
| } ); | |
| } ); | |
| </script> | |
| <?php | |
| } | |
| add_action( 'print_media_templates', 'additional_gallery_settings' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment