WordPress.org

Make WordPress Core

Ticket #24538: 24538.diff

File 24538.diff, 970 bytes (added by kovshenin, 5 years ago)
  • wp-content/themes/twentythirteen/functions.php

     
    580580        wp_enqueue_script( 'twentythirteen-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20130226', true );
    581581}
    582582add_action( 'customize_preview_init', 'twentythirteen_customize_preview_js' );
     583
     584/**
     585 * Get the medium image instead of the small one when embedding from Instagram
     586 *
     587 * @since Twenty Thirteen 1.0
     588 */
     589function twentythirteen_oembed_fetch_url( $provider, $url, $args ) {
     590        if ( 0 !== strpos( $provider, 'http://api.instagram.com/oembed' ) && $args['width'] < 612 )
     591                return $provider;
     592
     593        return add_query_arg( 'maxwidth', 612, $provider );
     594}
     595add_filter( 'oembed_fetch_url', 'twentythirteen_oembed_fetch_url', 10, 3 );
     596
     597