Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. function jig_detect_ngg_tag($content){
  2. global $post;
  3. if($post->post_name == 'ngg_tag'){
  4. if(preg_match('/ngg_images.*source.*tags.*slug=\'([^\'"]*)\'.*photocrati-nextgen_basic_thumbnails/i', $content, $groups)){
  5. $tag = $groups[1];
  6. $content = "[justified_image_grid ng_tags_gallery={$tag}]";
  7. }else{ // legacy
  8. preg_match_all('/(?<=data-image-id=")(\d+)(?=")/im', $content, $result, PREG_PATTERN_ORDER);
  9. $ids = implode(',',$result[0]);
  10. if(!empty($ids)){
  11. $content = "[justified_image_grid ng_pics={$ids}]";
  12. }else{
  13. return $this->frontend_stop(__("Justified Image Grid couldn't take over NextGEN tags page.", 'jig_td').'<br />'.$content);
  14. }
  15. }
  16. }
  17. return $content;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement