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, $caption, $title, $align, $url, $size, $alt = '' ) {
132
133      if ( empty($caption) || apply_filters( 'disable_captions', '' ) )
134           return $html;
135
136      $id = ( 0 < (int) $id ) ? 'attachment_' . $id : '';
137
138      if ( ! preg_match( '/width="([0-9]+)/', $html, $matches ) )
139           return $html;
140
141      $width = $matches[1];
142
 
Line Code
1668
1669           if ( f.title.value ) {
1670                title = f.title.value.replace(/'/g, '&#039;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
1671                title = ' title="'+title+'"';
1672           }
1673
1674           if ( f.alt.value )
1675                alt = f.alt.value.replace(/'/g, '&#039;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
1676
1677 <?php if ( ! apply_filters( 'disable_captions', '' ) ) { ?>
1678           if ( f.caption.value )
1679                caption = f.caption.value.replace(/'/g, '&#039;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
1680 <?php } ?>
1681
1682           cls = caption ? '' : ' class="'+t.align+'"';
1683
1684           html = '<img alt="'+alt+'" src="'+f.src.value+'"'+title+cls+' width="'+t.width+'" height="'+t.height+'" />';
1685
1686           if ( f.url.value )
 
Line Code
2048
2049 /**
2050  * {@internal Missing Short Description}}
2051  *
2052  * @since 2.7.0
2053  *
2054  * @return unknown
2055  */
2056 function type_url_form_image() {
2057      if ( !apply_filters( 'disable_captions', '' ) ) {
2058           $caption = '
2059           <tr>
2060                <th valign="top" scope="row" class="label">
2061                     <span class="alignleft"><label for="caption">' . __('Image Caption') . '</label></span>
2062                </th>
2063                <td class="field"><input id="caption" name="caption" value="" type="text" /></td>
2064           </tr>
2065 ';
2066      } else {