Last active
February 13, 2016 20:26
-
-
Save pawelkmpt/591095e73b0de1d8aef5 to your computer and use it in GitHub Desktop.
WordPress gallery default values filter
This file contains 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
<?php | |
// See more in wp-includes/js/media-editor.js | |
// wp.media._galleryDefaults | |
// and wp-includes/media.php | |
add_filter( 'media_view_settings', function( $settings, $post ) { | |
$settings['galleryDefaults'] = array( | |
itemtag => 'dl', | |
icontag => 'dt', | |
captiontag => 'dd', | |
columns => '3', | |
link => 'post', // possible values: post, file, none | |
size => 'thumbnail', | |
order => 'ASC', | |
orderby => 'menu_order ID', | |
); | |
return $settings; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment