Ticket #25515: 25515.2.diff
File 25515.2.diff, 2.0 KB (added by , 11 years ago) |
---|
-
src/wp-includes/class-wp-embed.php
153 153 foreach ( $handlers as $id => $handler ) { 154 154 if ( preg_match( $handler['regex'], $url, $matches ) && is_callable( $handler['callback'] ) ) { 155 155 if ( false !== $return = call_user_func( $handler['callback'], $matches, $attr, $url, $rawattr ) ) 156 /** 157 * Filter the returned embed handler. 158 * 159 * @since 2.9.0 160 * 161 * @param mixed $return The function to be called. 162 * @param string $url The URL attempting to be embedded. 163 * @param array $attr The shortcode attributes. 164 */ 156 165 return apply_filters( 'embed_handler_html', $return, $url, $attr ); 157 166 } 158 167 } … … 175 184 return $this->maybe_make_link( $url ); 176 185 177 186 if ( ! empty( $cache ) ) 187 /** 188 * Filter the returned cached HTML. 189 * 190 * @since 2.9.0 191 * 192 * @param mixed $cache The cached result, stored in the post meta. 193 * @param string $url The URL attempting to be embedded. 194 * @param array $attr The shortcode attributes. 195 * @param int $post_ID The post ID. 196 */ 178 197 return apply_filters( 'embed_oembed_html', $cache, $url, $attr, $post_ID ); 179 198 } 180 199 … … 188 207 189 208 // If there was a result, return it 190 209 if ( $html ) 210 //duplicate_hook 191 211 return apply_filters( 'embed_oembed_html', $html, $url, $attr, $post_ID ); 192 212 } 193 213 … … 271 291 */ 272 292 function maybe_make_link( $url ) { 273 293 $output = ( $this->linkifunknown ) ? '<a href="' . esc_url($url) . '">' . esc_html($url) . '</a>' : $url; 294 295 /** 296 * Filter the returned URL, which is either linked or not. 297 * 298 * @since 2.9.0 299 * 300 * @param string $output The linked URL or the original URL. 301 * @param string $url The original URL. 302 */ 274 303 return apply_filters( 'embed_maybe_make_link', $output, $url ); 275 304 } 276 305 }