image_add_caption [ WordPress Function ]
image_add_caption ( $html, $id, $caption, $title, $align, $url, $size, $alt = '' )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: _cleanup_image_add_caption, add_option, add_action, maybe_add_column, tag_description
{@internal Missing Short Description}}
Source
<?php
function image_add_caption( $html, $id, $caption, $title, $align, $url, $size, $alt = '' ) {
if ( empty($caption) || apply_filters( 'disable_captions', '' ) )
return $html;
$id = ( 0 < (int) $id ) ? 'attachment_' . $id : '';
if ( ! preg_match( '/width=["\']([0-9]+)/', $html, $matches ) )
return $html;
$width = $matches[1];
$caption = str_replace( array("\r\n", "\r"), "\n", $caption);
$caption = preg_replace_callback( '/<[a-zA-Z0-9]+(?: [^<>]+>)*/', '_cleanup_image_add_caption', $caption );
// convert any remaining line breaks to <br>
$caption = preg_replace( '/[ \n\t]*\n[ \t]*/', '<br />', $caption );
$html = preg_replace( '/(class=["\'][^\'"]*)align(none|left|right|center)\s?/', '$1', $html );
if ( empty($align) )
$align = 'none';
$shcode = '[caption id="' . $id . '" align="align' . $align . '" width="' . $width . '"]' . $html . ' ' . $caption . '[/caption]';
return apply_filters( 'image_add_caption_shortcode', $shcode, $html );
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- image_add_caption | A HitchHackers guide through WordPress
Feb 12, 2011 ... function image_add_caption( $html, $id, $caption, $title, $align, $url, $size, $alt = '' ) { if ( empty($caption) || apply_filters( 'disable_captions', ...
hitchhackerguide.com - PHPXRef 0.7 : WordPress : Detail view of media.php
image_add_caption() _cleanup_image_add_caption() ...
phpxref.ftwr.co.uk - image_add_caption_shortcode Wordpress hook details -- Adam ...
We find related hooks using word stems. image_add_caption_shortcode has 4 significant word stem(s): image , add , caption , shortcode . Note that some of the ...
adambrown.info - Rendering Images in TYPO3 4.3: Part 1 | Packt Publishing Technical ...
You can also resize the image, add caption, alt tags for accessibility and search engine optimization, and change default processing options. See the official ...
www.packtpub.com