Add "General - Auto ThickBox - Links with target attribute" option. class="thickbox" is not added to links with target attribute by default.

This commit is contained in:
attosoft committed 2012-05-20 13:05:06 +00:00
1 parent bc62f4c4ba
commit 28652e6232
2 files changed
+6 -2

No files matched your search

+3 -1
View File
@@ -88,7 +88,9 @@ jQuery(function($) {
<th scope="row"><?php _e('Auto ThickBox', 'auto-thickbox'); ?></th>
<td>
<label><input type="checkbox" name="auto-thickbox-plus[thickbox_text]"<?php $this->checked($this->options['thickbox_text'], 'on'); ?> />
<?php _e('Text links to images', 'auto-thickbox'); ?> (<code>&lt;a href="image">text&lt;/a></code>)</label>
<?php _e('Text links to images', 'auto-thickbox'); ?> (<code>&lt;a href="image">text&lt;/a></code>)</label><br />
<label><input type="checkbox" name="auto-thickbox-plus[thickbox_target]"<?php $this->checked($this->options['thickbox_target'], 'on'); ?> />
<?php _e('Links with target attribute', 'auto-thickbox'); ?> (<code>&lt;a target="_blank"></code>)</label>
</td>
</tr>
<tr>
+3 -1
View File
@@ -64,7 +64,8 @@ class auto_thickbox {
* @return anchor $anchor
**/
function image($anchor) {
if ( $this->options['thickbox_text'] == 'off' && !preg_match("/^\s*<\s*img\s.+?>\s*$/is", $anchor['body']) )
if ( ($this->options['thickbox_text'] == 'off' && !preg_match("/^\s*<\s*img\s.+?>\s*$/is", $anchor['body']))
|| ($this->options['thickbox_target'] == 'off' && !empty($anchor['attr']['target'])) )
return $anchor;
if ( !$anchor['attr']['class'] ) {
@@ -423,6 +424,7 @@ SCRIPT;
$this->options_def = array(
'thickbox_style' => 'single',
'thickbox_text' => 'on',
'thickbox_target' => 'off',
'auto_resize' => 'on',
'builtin_res' => 'off',
'script_place' => 'header',