summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/functions.photon.php')
-rw-r--r--plugins/jetpack/functions.photon.php20
1 files changed, 6 insertions, 14 deletions
diff --git a/plugins/jetpack/functions.photon.php b/plugins/jetpack/functions.photon.php
index b3465207..a038b702 100644
--- a/plugins/jetpack/functions.photon.php
+++ b/plugins/jetpack/functions.photon.php
@@ -175,20 +175,6 @@ function jetpack_photon_url( $image_url, $args = array(), $scheme = null ) {
*/
$subdomain = abs( crc32( $image_host_path ) % 3 );
- /*
- * Need to perform a slowroll out per pMz3w-arH-p2
- *
- * 7.9 - Use the old method if the value is not 0 (thus 1 or 2).
- * 8.0 - Use the old method if the value is 2 (thus not 0 or 1). [current step]
- * 8.1 - Remove this completely.
- */
- if ( 2 === $subdomain ) {
- // Figure out which CDN subdomain to use.
- srand( crc32( $image_host_path ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.rand_seeding_srand
- $subdomain = rand( 0, 2 ); // phpcs:ignore WordPress.WP.AlternativeFunctions.rand_rand
- srand(); // phpcs:ignore WordPress.WP.AlternativeFunctions.rand_seeding_srand
- }
-
/**
* Filters the domain used by the Photon module.
*
@@ -234,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 );
/**