Add "Default Display Style - Set a different gallery-id for each WordPress Gallery" option. You can use "Gallery Images" style in WordPress Gallery even when using "Single Image" style.

This commit is contained in:
attosoft committed 2012-05-20 13:32:39 +00:00
1 parent 5d5380d4e6
commit edff5afdcf
2 files changed
+24 -1

No files matched your search

+8 -1
View File
@@ -84,6 +84,13 @@ jQuery(function($) {
<?php _e('Gallery Images', 'auto-thickbox'); ?> (<code>&lt;a href="image" rel="gallery-id">&lt;img />&lt;/a></code>)</label>
</td>
</tr>
<tr>
<th scope="row"></th>
<td>
<label><input type="checkbox" name="auto-thickbox-plus[wp_gallery]"<?php $this->checked($this->options['wp_gallery'], 'on'); ?> />
<?php _e('Set a different gallery-id for each WordPress Gallery', 'auto-thickbox'); ?> (<code>[gallery link="file"]</code>)</label>
</td>
</tr>
<tr>
<th scope="row"><?php _e('Auto ThickBox', 'auto-thickbox'); ?></th>
<td>
@@ -832,7 +839,7 @@ jQuery(function($) {
register_setting( 'auto-thickbox-plus-options', 'auto-thickbox-plus', array(&$this, 'options_callback') );
}
var $checkboxes_on = array('thickbox_text', 'auto_resize',
var $checkboxes_on = array('wp_gallery', 'thickbox_text', 'auto_resize',
'key_close_esc', 'key_close_enter',
'key_prev_angle', 'key_prev_left',
'key_next_angle', 'key_next_right',
+16
View File
@@ -159,6 +159,21 @@ class auto_thickbox {
} # styles()
function footer_scripts() {
if ( $this->options['wp_gallery'] == 'on') {
?>
<script type="text/javascript">
/* <![CDATA[ */
jQuery(function($) {
$('div.gallery').each(function() {
var id = $(this).attr('class').match(/galleryid-\d+/);
$(this).find('a.thickbox').attr('rel', id);
});
});
/* ]]> */
</script>
<?php
}
if ( $this->options['builtin_res'] == 'on') {
if ( version_compare('3.2', get_bloginfo('version')) > 0 ) {
$includes_url = includes_url();
@@ -429,6 +444,7 @@ SCRIPT;
$this->options_def = array(
'thickbox_style' => 'single',
'wp_gallery' => 'on',
'thickbox_text' => 'on',
'thickbox_target' => 'off',
'no_thickbox' => 'nothickbox no_thickbox ',