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.
| Line | Code |
|---|---|
| 1429 | * @return string The embed HTML. |
| 1430 | */ |
| 1431 | function wp_embed_handler_video( $matches, $attr, $url, $rawattr ) { |
| 1432 | $dimensions = ''; |
| 1433 | if ( ! empty( $rawattr['width'] ) && ! empty( $rawattr['height'] ) ) { |
| 1434 | $dimensions .= sprintf( 'width="%d" ', (int) $rawattr['width'] ); |
| 1435 | $dimensions .= sprintf( 'height="%d" ', (int) $rawattr['height'] ); |
| 1436 | } |
| 1437 | $video = sprintf( '[video %s src="%s" /]', $dimensions, esc_url( $url ) ); |
| 1438 | return apply_filters( 'wp_embed_handler_video', $video, $attr, $url, $rawattr ); |
| 1439 | } |
| 1440 | |
| 1441 | /** |
| 1442 | * Converts a shorthand byte value to an integer byte value. |
| 1443 | * |
| 1444 | * @since 2.3.0 |
| 1445 | * |
| 1446 | * @param string $size A shorthand byte value. |
| 1447 | * @return int An integer byte value. |