Skip to content

Commit

Permalink
Photon: Remove duplicate jetpack_photon_url filter (#14323)
Browse files Browse the repository at this point in the history
There are two calls to add_filter('jetpack_photon_url', 'jetpack_photon_url'): one
is in load_jetpack.php, and one is in functions.photon.php. Clean up this
duplication by removing the add_filter() call in load_jetpack.php.

I chose to put the add_filter() call in functions.photon.php because it looks like
this will be easier to sync with wpcom.
  • Loading branch information
kbrown9 authored and zinigor committed Jan 17, 2020
1 parent 5b40965 commit ff76ea1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 6 additions & 0 deletions functions.photon.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ function jetpack_photon_url( $image_url, $args = array(), $scheme = null ) {

return jetpack_photon_url_scheme( $photon_url, $scheme );
}

/**
* Add an easy way to photon-ize a URL that is safe to call even if Jetpack isn't active.
*
* See: https://jetpack.com/2013/07/11/photon-and-themes/
*/
add_filter( 'jetpack_photon_url', 'jetpack_photon_url', 10, 3 );

/**
Expand Down
9 changes: 0 additions & 9 deletions load-jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,6 @@ function jetpack_should_use_minified_assets() {
add_filter( 'jetpack_static_url', array( 'Jetpack', 'staticize_subdomain' ) );
add_filter( 'is_jetpack_site', '__return_true' );

/**
* Add an easy way to photon-ize a URL that is safe to call even if Jetpack isn't active.
*
* See: https://jetpack.com/2013/07/11/photon-and-themes/
*/
if ( Jetpack::is_module_active( 'photon' ) ) {
add_filter( 'jetpack_photon_url', 'jetpack_photon_url', 10, 3 );
}

if ( JETPACK__SANDBOX_DOMAIN ) {
require_once JETPACK__PLUGIN_DIR . '_inc/jetpack-server-sandbox.php';
}
Expand Down

0 comments on commit ff76ea1

Please sign in to comment.