WordPress.org

Make WordPress Core

Ticket #16996: 16996.diff

File 16996.diff, 818 bytes (added by jacobwg, 3 years ago)

Initial patch to allow for any custom [embed] parameters to be passed on to the oEmbed request

  • wp-includes/class-oembed.php

     
    169169                $provider = add_query_arg( 'maxheight', $args['height'], $provider ); 
    170170                $provider = add_query_arg( 'url', urlencode($url), $provider ); 
    171171 
     172                // hackish way to remove strangely (non-oAuth) named args 
     173                unset($args['width']); 
     174                unset($args['height']); 
     175                unset($args['discover']); 
     176 
     177                foreach ( $args as $key => $value ) { 
     178                        $provider = add_query_arg( $key, $value, $provider ); 
     179                } 
     180 
    172181                foreach( array( 'json', 'xml' ) as $format ) { 
    173182                        $result = $this->_fetch_with_format( $provider, $format ); 
    174183                        if ( is_wp_error( $result ) && 'not-implemented' == $result->get_error_code() )