Changeset 964749
- Timestamp:
- 08/12/2014 07:44:33 PM (12 years ago)
- Location:
- restore-image-title/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (3 diffs)
-
restore-image-title.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
restore-image-title/trunk/readme.txt
r900371 r964749 3 3 Tags: image, title 4 4 Requires at least: 3.5 5 Tested up to: 3.96 Stable tag: 1. 15 Tested up to: 4 Beta 2 6 Stable tag: 1.5 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 39 39 * Checks for existence of title attribute before adding anything. Filters title with esc_attr() to avoid any markup in the title breaking the img tag. 40 40 41 = 1.5 = 42 * Now adds titles to gallery thumbnails, which also works for at least some lightbox plugins. Thanks to photoMaldives for posting code and OC2PS for prompting me to update the plugin. 43 41 44 == Upgrade Notice == 42 45 … … 47 50 Checks for existence of title attribute before adding anything. Filters title with esc_attr() to avoid any markup in the title breaking the ing tag. 48 51 52 = 1.5 = 53 New feature - now adds titles to gallery thumbnails and to images displayed by lightbox plugins. -
restore-image-title/trunk/restore-image-title.php
r645012 r964749 3 3 Plugin Name: Restore Image Title 4 4 Description: Reverses WP 3.5's behaviour of stripping title from images inserted into posts 5 Version: 1. 15 Version: 1.5 6 6 License: GPL 7 7 Author: Les Bessant … … 21 21 } 22 22 add_filter( 'media_send_to_editor', 'lcb_restore_image_title', 15, 2 ); 23 24 function lcb_restore_title_to_gallery( $content, $id ) { 25 $thumb_title = get_the_title($id); 26 return str_replace('<a', '<a title="' . esc_attr($thumb_title) . '" ', $content); 27 } 28 add_filter('wp_get_attachment_link', 'lcb_restore_title_to_gallery', 10, 4); 29 23 30 ?>
Note: See TracChangeset
for help on using the changeset viewer.