Skip to content
Snippets Groups Projects
Commit a39e8638 authored by Erick Hitter's avatar Erick Hitter
Browse files

* Check if Photon is active, not just if function is present.

* Clean up PHPDoc
* Collapse an array
parent fa1e8732
No related branches found
No related tags found
No related merge requests found
......@@ -68,13 +68,14 @@ class Jetpack_Photon_for_NextGEN {
}
/**
* Load plugin's actions if Jetpack is present.
* Load plugin's actions if Jetpack is present and Photon module is active.
*
* @uses add_action
* @uses Jetpack::get_active_modules, is_admin, apply_filters, this::parse_nextgen_options, add_action
* @return null
*/
public function action_wp_loaded() {
// Requires Jetpack
if ( ! function_exists( 'jetpack_photon_url' ) )
if ( ! function_exists( 'jetpack_photon_url' ) || ! in_array( 'photon', Jetpack::get_active_modules() ) )
return;
// Don't mess with the admin, unless someone really wants to
......@@ -148,11 +149,7 @@ class Jetpack_Photon_for_NextGEN {
$image->thumbURL = $thumb;
//Update markup
$properties = array(
'href',
'imageHTML',
'thumbHTML'
);
$properties = array( 'href', 'imageHTML', 'thumbHTML' );
foreach ( $properties as $property ) {
$image->{$property} = str_replace( $src_orig, $src, $image->{$property} );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment