Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: disable_captions

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 3 times in this file.

Line Code
124  * @param unknown_type $alt
125  * @param unknown_type $title
126  * @param unknown_type $align
127  * @param unknown_type $url
128  * @param unknown_type $size
129  * @return unknown
130  */
131 function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) {
132
133      if ( empty($alt) || apply_filters( 'disable_captions', '' ) )
134           return $html;
135
136      $id = ( 0 < (int) $id ) ? 'attachment_' . $id : '';
137
138      preg_match( '/width="([0-9]+)/', $html, $matches );
139      if ( ! isset($matches[1]) )
140           return $html;
141
142      $width = $matches[1];
 
Line Code
1480           if ( '' == f.src.value || '' == t.width ) return false;
1481
1482           if ( f.title.value ) {
1483                title = f.title.value.replace(/['"<>]+/g, '');
1484                title = ' title="'+title+'"';
1485           }
1486
1487           if ( f.alt.value ) {
1488                alt = f.alt.value.replace(/['"<>]+/g, '');
1489 <?php if ( ! apply_filters( 'disable_captions', '' ) ) { ?>
1490                caption = f.alt.value.replace(/'/g, '&#39;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
1491 <?php } ?>
1492           }
1493
1494           cls = caption ? '' : ' class="'+t.align+'"';
1495
1496           html = '<img alt="'+alt+'" src="'+f.src.value+'"'+title+cls+' width="'+t.width+'" height="'+t.height+'" />';
1497
1498           if ( f.url.value )
 
Line Code
1856 /**
1857  * {@internal Missing Short Description}}
1858  *
1859  * @since unknown
1860  *
1861  * @return unknown
1862  */
1863 function type_url_form_image() {
1864
1865      if ( apply_filters( 'disable_captions', '' ) ) {
1866           $alt = __('Alternate Text');
1867           $alt_help = __('Alt text for the image, e.g. &#8220;The Mona Lisa&#8221;');
1868      } else {
1869           $alt = __('Image Caption');
1870           $alt_help = __('Also used as alternate text for the image');
1871      }
1872
1873      $default_align = get_option('image_default_align');
1874      if ( empty($default_align) )