Skip to content

Instantly share code, notes, and snippets.

@Firsh
Created June 5, 2015 10:49
Show Gist options
  • Save Firsh/999122b30bc7adc4ee82 to your computer and use it in GitHub Desktop.
Save Firsh/999122b30bc7adc4ee82 to your computer and use it in GitHub Desktop.
Upcoming fix
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