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
1565
1566           if ( f.title.value ) {
1567                title = f.title.value.replace(/'/g, '&#039;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
1568                title = ' title="'+title+'"';
1569           }
1570
1571           if ( f.alt.value )
1572                alt = f.alt.value.replace(/'/g, '&#039;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
1573
1574 <?php if ( ! apply_filters( 'disable_captions', '' ) ) { ?>
1575           if ( f.caption.value )
1576                caption = f.caption.value.replace(/'/g, '&#039;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
1577 <?php } ?>
1578
1579           cls = caption ? '' : ' class="'+t.align+'"';
1580
1581           html = '<img alt="'+alt+'" src="'+f.src.value+'"'+title+cls+' width="'+t.width+'" height="'+t.height+'" />';
1582
1583           if ( f.url.value )
 
Line Code
1945 /**
1946  * {@internal Missing Short Description}}
1947  *
1948  * @since unknown
1949  *
1950  * @return unknown
1951  */
1952 function type_url_form_image() {
1953
1954      if ( !apply_filters( 'disable_captions', '' ) ) {
1955           $caption = '
1956           <tr>
1957                <th valign="top" scope="row" class="label">
1958                     <span class="alignleft"><label for="caption">' . __('Image Caption') . '</label></span>
1959                </th>
1960                <td class="field"><input id="caption" name="caption" value="" type="text" /></td>
1961           </tr>
1962 ';
1963      } else {