Plugin T5 Add Thickbox Support
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 # -*- coding: utf-8 -*- | |
/** | |
* Plugin Name: T5 Add Thickbox Support | |
* Plugin URI: http://toscho.de/?p=1997 | |
* Description: Enables the Thickbox script for the theme. | |
* Version: 2012.08.12 | |
* Author: Thomas Scholz <info@toscho.de> | |
* Author URI: http://toscho.de | |
* License: MIT | |
* License URI: http://www.opensource.org/licenses/mit-license.php | |
*/ | |
add_action( 'wp_enqueue_scripts', 'add_thickbox' ); | |
add_action( 'wp_footer', 't5_thickbox_jquery' ); | |
/** | |
* Print JavaScript to make linked images thickboxy. | |
* | |
* @return void | |
*/ | |
function t5_thickbox_jquery() | |
{ | |
?> | |
<script> | |
jQuery( 'a img.size-medium, a img.attachment-thumbnail' ) | |
.parent() | |
.addClass( 'thickbox' ) | |
.attr( 'rel', 'page' ); | |
</script> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment