Changeset 8239 for trunk/wp-includes/media.php
- Timestamp:
- 07/02/2008 06:41:11 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/media.php
r8029 r8239 349 349 350 350 return $html; 351 } 352 353 add_shortcode('wp_caption', 'wp_caption_shortcode'); 354 355 function wp_caption_shortcode($attr, $content = null) { 356 357 // Allow plugins/themes to override the default caption template. 358 $output = apply_filters('wp_caption_shortcode', '', $attr, $content); 359 if ( $output != '' ) 360 return $output; 361 362 extract(shortcode_atts(array( 363 'id' => '', 364 'align' => 'alignnone', 365 'width' => '', 366 'caption' => '' 367 ), $attr)); 368 369 if ( 1 > (int) $width || empty($caption) ) 370 return $content; 371 372 if ( $id ) $id = 'id="' . $id . '" '; 373 374 return '<dl ' . $id . 'class="wp_caption ' . $align . '" style="width: ' . (10 + (int) $width) . 'px">' 375 . '<dt class="wp_caption_dt">' . $content . '</dt><dd class="wp_caption_dd">' . $caption . '</dd></dl>'; 351 376 } 352 377
Note: See TracChangeset
for help on using the changeset viewer.