WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 3 times in this file.
Line | Code |
---|---|
129 | * @param string $alt image alt attribute |
130 | * @param string $title image title attribute |
131 | * @param string $align image css alignment property |
132 | * @param string $url image src url |
133 | * @param string $size image size (thumbnail, medium, large, full or added with add_image_size() ) |
134 | * @return string |
135 | */ |
136 | function image_add_caption( $html, $id, $caption, $title, $align, $url, $size, $alt = '' ) { |
137 |
|
138 | if ( empty($caption) || apply_filters( 'disable_captions', '' ) ) |
139 | return $html; |
140 |
|
141 | $id = ( 0 < (int) $id ) ? 'attachment_' . $id : ''; |
142 |
|
143 | if ( ! preg_match( '/width=["\']([0-9]+)/', $html, $matches ) ) |
144 | return $html; |
145 |
|
146 | $width = $matches[1]; |
147 |
|
Line | Code |
1734 | insert : function() { |
1735 | var t = this, html, f = document.forms[0], cls, title = '', alt = '', caption = ''; |
1736 |
|
1737 | if ( '' == f.src.value || '' == t.width ) |
1738 | return false; |
1739 |
|
1740 | if ( f.alt.value ) |
1741 | alt = f.alt.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>'); |
1742 |
|
1743 | <?php if ( ! apply_filters( 'disable_captions', '' ) ) { ?> |
1744 | if ( f.caption.value ) { |
1745 | caption = f.caption.value.replace(/\r\n|\r/g, '\n'); |
1746 | caption = caption.replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g, function(a){ |
1747 | return a.replace(/[\r\n\t]+/, ' '); |
1748 | }); |
1749 |
|
1750 | caption = caption.replace(/\s*\n\s*/g, '<br />'); |
1751 | } |
1752 | <?php } ?> |
Line | Code |
2140 | /** |
2141 | * Creates the form for external url |
2142 | * |
2143 | * @since 2.7.0 |
2144 | * |
2145 | * @param string $default_view |
2146 | * @return string the form html |
2147 | */ |
2148 | function wp_media_insert_url_form( $default_view = 'image' ) { |
2149 | if ( !apply_filters( 'disable_captions', '' ) ) { |
2150 | $caption = ' |
2151 | <tr class="image-only"> |
2152 | <th valign="top" scope="row" class="label"> |
2153 | <label for="caption"><span class="alignleft">' . __('Image Caption') . '</span></label> |
2154 | </th> |
2155 | <td class="field"><textarea id="caption" name="caption"></textarea></td> |
2156 | </tr> |
2157 | '; |
2158 | } else { |