Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fix_gall($content){
- preg_match_all('#(\[gallery.+?\])#is',$content,$listgall);
- foreach($listgall[1] as $gall){
- if (stripos($gall,'link=') === false) $content = str_replace($gall, substr($gall, 0, -1).' link="file"]', $content);
- }
- return $content ;
- }
- add_filter('content_save_pre','fix_gall');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement