Created
June 5, 2015 10:49
-
-
Save Firsh/999122b30bc7adc4ee82 to your computer and use it in GitHub Desktop.
Upcoming fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function jig_detect_ngg_tag($content){ | |
global $post; | |
if($post->post_name == 'ngg_tag'){ | |
if(preg_match('/ngg_images.*source.*tags.*slug=\'([^\'"]*)\'.*photocrati-nextgen_basic_thumbnails/i', $content, $groups)){ | |
$tag = $groups[1]; | |
$content = "[justified_image_grid ng_tags_gallery={$tag}]"; | |
}else{ // legacy | |
preg_match_all('/(?<=data-image-id=")(\d+)(?=")/im', $content, $result, PREG_PATTERN_ORDER); | |
$ids = implode(',',$result[0]); | |
if(!empty($ids)){ | |
$content = "[justified_image_grid ng_pics={$ids}]"; | |
}else{ | |
return $this->frontend_stop(__("Justified Image Grid couldn't take over NextGEN tags page.", 'jig_td').'<br />'.$content); | |
} | |
} | |
} | |
return $content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment