Make WordPress Core

Ticket #16996: 16996-filter.diff

File 16996-filter.diff, 645 bytes (added by Otto42, 12 years ago)

Simpler filter which makes the parameters easily pluggable

  • wp-includes/class-oembed.php

     
    162162                $provider = add_query_arg( 'maxwidth', (int) $args['width'], $provider );
    163163                $provider = add_query_arg( 'maxheight', (int) $args['height'], $provider );
    164164                $provider = add_query_arg( 'url', urlencode($url), $provider );
     165               
     166                $provider = apply_filters( 'oembed_fetch_url', $provider, $args, $url );
    165167
    166168                foreach( array( 'json', 'xml' ) as $format ) {
    167169                        $result = $this->_fetch_with_format( $provider, $format );