View Single Post
Old 05-08-2013, 03:04 PM  
rogueteens
So fucking bland
 
rogueteens's Avatar
 
Industry Role:
Join Date: Jul 2006
Location: England
Posts: 8,005
Quote:
Originally Posted by Colmike7 View Post
Code:
<?php
/* Plugin Name: (#50911) Open gallery img in new window/tab */

add_action( 'after_setup_theme', 'wpse50911_replace_img_shortcodes' );
function wpse50911_replace_img_shortcodes()
{
    remove_shortcode( 'gallery', 'gallery_shortcode' );
    add_shortcode( 'gallery', 'wpse50911_gallery_shortcode' );

    remove_shortcode( 'caption', 'img_caption_shortcode' );
    add_shortcode( 'caption', 'wpse50911_caption_shortcode' );

    remove_shortcode( 'wp_caption', 'img_caption_shortcode' );
    add_shortcode( 'wp_caption', 'wpse50911_caption_shortcode' );
}
function wpse50911_gallery_shortcode( $attr )
{
    return links_add_target( gallery_shortcode( $attr ) );
}
function wpse50911_caption_shortcode( $attr, $content = null)
{
    return img_caption_shortcode( $attr, links_add_target( $content ) );
}
?>
thank you very much
__________________
Free traffic and backlinks from one of the fastest growing adult pinsites on the net - SAUCY PICTURES!
Easily my best performing webcam sponsor - CLICK HERE!!
rogueteens is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote