Skip to content

Commit fe48e76

Browse files
committed
Photon: Bail on URL creation when in JP Development Mode
1 parent bd639c2 commit fe48e76

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎functions.photon.php‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,21 @@
1212
function jetpack_photon_url( $image_url, $args = array(), $scheme = null ) {
1313
$image_url = trim( $image_url );
1414

15+
if ( class_exists( 'Jetpack') ) {
16+
/**
17+
* Disables Photon URL processing for local development
18+
*
19+
* @module photon
20+
*
21+
* @since 4.1.0
22+
*
23+
* @param bool false Result of Jetpack::is_development_mode.
24+
*/
25+
if ( true === apply_filters( 'jetpack_photon_development_mode', Jetpack::is_development_mode() ) ) {
26+
return $image_url;
27+
}
28+
}
29+
1530
/**
1631
* Allow specific image URls to avoid going through Photon.
1732
*

0 commit comments

Comments
 (0)