Making WordPress.org

Changeset 10664


Ignore:
Timestamp:
02/12/2021 12:44:14 AM (6 years ago)
Author:
dd32
Message:

Showcase: Use Jetpack Photon for uploaded images, this adds the support for resizing via the w arg.

Fixes #5612.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-showcase/functions.php

    r10336 r10664  
    3737
    3838        $screenshot = get_post_meta($post->ID, 'screenshot', true);
    39 
    40         $prefix = is_ssl() ? 'https://' : 'http://s.';
     39       
    4140        if ( empty( $screenshot ) ) {
     41                $prefix = is_ssl() ? 'https://' : 'http://s.';
    4242                $screenshot = $prefix.'wordpress.com/mshots/v1/http%3A%2F%2F' . get_site_domain( true, false );
    43         }
    44 
    45         if ( '' != $width ) {
     43        } elseif ( function_exists( 'jetpack_photon_url' ) ) {
     44                $screenshot = jetpack_photon_url( $screenshot );
     45        }
     46
     47        if ( $width ) {
    4648                $screenshot = add_query_arg( 'w', $width, $screenshot);
    4749        }
Note: See TracChangeset for help on using the changeset viewer.