Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: oembed_iframe_title_attribute

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

Line Code
841       * Filters the title attribute of the given oEmbed HTML iframe.
842       *
843       * @since 5.2.0
844       *
845       * @param string $title  The title attribute.
846       * @param string $result The oEmbed HTML result.
847       * @param object $data   A data object result from an oEmbed provider.
848       * @param string $url    The URL of the content to be embedded.
849       */
850      $title = apply_filters( 'oembed_iframe_title_attribute', $title, $result, $data, $url );
851
852      if ( '' === $title ) {
853           return $result;
854      }
855
856      if ( isset( $attrs['title'] ) ) {
857           unset( $attrs['title'] );
858           $attr_string = implode( ' ', wp_list_pluck( $attrs, 'whole' ) );
859           $result      = str_replace( $matches[0], '<iframe ' . trim( $attr_string ) . '>', $result );