| @@ -6,8 +6,14 @@ | ||
| 6 | 6 | * |
| 7 | 7 | * @package automattic/jetpack |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | +use Automattic\Jetpack\Image_CDN\Image_CDN; | |
| 11 | + | |
| 12 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 13 | + exit( 0 ); | |
| 14 | +} | |
| 15 | + | |
| 10 | 16 | // Priority 11 needed to ensure sharing_display is loaded. |
| 11 | 17 | add_action( 'init', 'jetpack_bbpress_compat', 11 ); |
| 12 | 18 | |
| 13 | 19 | /** |
| @@ -48,11 +54,11 @@ | ||
| 48 | 54 | * Use Photon for all images in Topics and replies. |
| 49 | 55 | * |
| 50 | 56 | * @since 4.9.0 |
| 51 | 57 | */ |
| 52 | - if ( class_exists( 'Jetpack_Photon' ) && Jetpack::is_module_active( 'photon' ) ) { | |
| 53 | - add_filter( 'bbp_get_topic_content', array( 'Jetpack_Photon', 'filter_the_content' ), 999999 ); | |
| 54 | - add_filter( 'bbp_get_reply_content', array( 'Jetpack_Photon', 'filter_the_content' ), 999999 ); | |
| 58 | + if ( class_exists( Image_CDN::class ) && Image_CDN::is_enabled() ) { | |
| 59 | + add_filter( 'bbp_get_topic_content', array( Image_CDN::class, 'filter_the_content' ), 999999 ); | |
| 60 | + add_filter( 'bbp_get_reply_content', array( Image_CDN::class, 'filter_the_content' ), 999999 ); | |
| 55 | 61 | } |
| 56 | 62 | } |
| 57 | 63 | |
| 58 | 64 | /** |