Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Plugin T5 Add Thickbox Support
<?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
You can’t perform that action at this time.