Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement