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
1694
1695           if ( f.title.value ) {
1696                title = f.title.value.replace(/'/g, '&#039;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
1697                title = ' title="'+title+'"';
1698           }
1699
1700           if ( f.alt.value )
1701                alt = f.alt.value.replace(/'/g, '&#039;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
1702
1703 <?php if ( ! apply_filters( 'disable_captions', '' ) ) { ?>
1704           if ( f.caption.value )
1705                caption = f.caption.value.replace(/'/g, '&#039;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
1706 <?php } ?>
1707
1708           cls = caption ? '' : ' class="'+t.align+'"';
1709
1710           html = '<img alt="'+alt+'" src="'+f.src.value+'"'+title+cls+' width="'+t.width+'" height="'+t.height+'" />';
1711
1712           if ( f.url.value )
 
Line Code
2074
2075 /**
2076  * {@internal Missing Short Description}}
2077  *
2078  * @since 2.7.0
2079  *
2080  * @return unknown
2081  */
2082 function type_url_form_image() {
2083      if ( !apply_filters( 'disable_captions', '' ) ) {
2084           $caption = '
2085           <tr>
2086                <th valign="top" scope="row" class="label">
2087                     <span class="alignleft"><label for="caption">' . __('Image Caption') . '</label></span>
2088                </th>
2089                <td class="field"><input id="caption" name="caption" value="" type="text" /></td>
2090           </tr>
2091 ';
2092      } else {