Changeset 12039
- Timestamp:
- 10/15/2009 02:27:04 PM (15 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/default-filters.php
r12023 r12039 216 216 add_action('transition_post_status', '_transition_post_status', 5, 3); 217 217 add_action('comment_form', 'wp_comment_form_unfiltered_html_nonce'); 218 // Post Image CSS class filtering 219 add_action( 'begin_fetch_post_image_html', '_wp_post_image_class_filter_add' ); 220 add_action( 'end_fetch_post_image_html', '_wp_post_image_class_filter_remove' ); 218 221 // Redirect Old Slugs 219 222 add_action('template_redirect', 'wp_old_slug_redirect'); -
trunk/wp-includes/media.php
r12035 r12039 557 557 } 558 558 559 /** 560 * Adds a 'wp-post-image' class to post image thumbnails 561 * Uses the begin_fetch_post_image_html and end_fetch_post_image_html action hooks to 562 * dynamically add/remove itself so as to only filter post image thumbnails 563 * 564 * @author Mark Jaquith 565 * @since 2.9.0 566 * @param array $attr Attributes including src, class, alt, title 567 * @return array 568 */ 569 function _wp_post_image_class_filter( $attr ) { 570 $attr['class'] .= ' wp-post-image'; 571 return $attr; 572 } 573 574 /** 575 * Adds _wp_post_image_class_filter to the wp_get_attachment_image_attributes filter 576 * 577 * @author Mark Jaquith 578 * @since 2.9.0 579 */ 580 function _wp_post_image_class_filter_add( $attr ) { 581 add_filter( 'wp_get_attachment_image_attributes', '_wp_post_image_class_filter' ); 582 } 583 584 /** 585 * Removes _wp_post_image_class_filter from the wp_get_attachment_image_attributes filter 586 * 587 * @author Mark Jaquith 588 * @since 2.9.0 589 */ 590 function _wp_post_image_class_filter_remove( $attr ) { 591 remove_filter( 'wp_get_attachment_image_attributes', '_wp_post_image_class_filter' ); 592 } 593 559 594 add_shortcode('wp_caption', 'img_caption_shortcode'); 560 595 add_shortcode('caption', 'img_caption_shortcode');
Note: See TracChangeset
for help on using the changeset viewer.