Guest User

Untitled

a guest
Jun 13th, 2013
750
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function fix_gall($content){
  2. preg_match_all('#(\[gallery.+?\])#is',$content,$listgall);
  3. foreach($listgall[1] as $gall){
  4. if (stripos($gall,'link=') === false) $content = str_replace($gall, substr($gall, 0, -1).' link="file"]', $content);
  5. }
  6. return $content ;
  7. }
  8. add_filter('content_save_pre','fix_gall');
RAW Paste Data