Changeset 3519
- Timestamp:
- 12/05/2010 06:59:53 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
bp-activity.php (modified) (2 diffs)
-
bp-blogs.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r3515 r3519 967 967 * @package BuddyPress Activity 968 968 * @param $content str - The content to work with 969 * @param $link str - Optional. The URL that the image should link to 969 970 * @return $content str - The content with images stripped and replaced with a single thumb. 970 971 */ 971 function bp_activity_thumbnail_content_images( $content ) { 972 function bp_activity_thumbnail_content_images( $content, $link = false ) { 973 global $post; 974 972 975 preg_match_all( '/<img[^>]*>/Ui', $content, $matches ); 973 976 $content = preg_replace('/<img[^>]*>/Ui', '', $content ); … … 995 998 $new_width = $new_height * $ratio; 996 999 997 $content = '<img src="' . esc_attr( $src) . '" width="' . $new_width . '" height="' . $new_height . '" alt="' . __( 'Thumbnail', 'buddypress' ) . '" class="align-left thumbnail" />' . $content; 1000 $image = '<img src="' . esc_attr( $src ) . '" width="' . $new_width . '" height="' . $new_height . '" alt="' . __( 'Thumbnail', 'buddypress' ) . '" class="align-left thumbnail" />'; 1001 1002 if ( !empty( $link ) ) { 1003 $image = '<a href="' . $link . '">' . $image . '</a>'; 1004 } 1005 1006 $content = $image . $content; 998 1007 } 999 1008 } -
trunk/bp-blogs.php
r3479 r3519 166 166 /* Remove large images and replace them with just one image thumbnail */ 167 167 if ( function_exists( 'bp_activity_thumbnail_content_images' ) && !empty( $content ) ) 168 $content = bp_activity_thumbnail_content_images( $content );168 $content = bp_activity_thumbnail_content_images( $content, $primary_link ); 169 169 170 170 if ( !empty( $action ) )
Note: See TracChangeset
for help on using the changeset viewer.