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 |
|---|---|
| 1490 | * @return string The embed HTML. |
| 1491 | */ |
| 1492 | function wp_embed_handler_video( $matches, $attr, $url, $rawattr ) { |
| 1493 | $dimensions = ''; |
| 1494 | if ( ! empty( $rawattr['width'] ) && ! empty( $rawattr['height'] ) ) { |
| 1495 | $dimensions .= sprintf( 'width="%d" ', (int) $rawattr['width'] ); |
| 1496 | $dimensions .= sprintf( 'height="%d" ', (int) $rawattr['height'] ); |
| 1497 | } |
| 1498 | $video = sprintf( '[video %s src="%s" /]', $dimensions, esc_url( $url ) ); |
| 1499 | return apply_filters( 'wp_embed_handler_video', $video, $attr, $url, $rawattr ); |
| 1500 | } |
| 1501 | |
| 1502 | /** |
| 1503 | * Converts a shorthand byte value to an integer byte value. |
| 1504 | * |
| 1505 | * @since 2.3.0 |
| 1506 | * |
| 1507 | * @param string $size A shorthand byte value. |
| 1508 | * @return int An integer byte value. |