Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

MrBrian

By: a guest on Oct 10th, 2008  |  syntax: PHP  |  size: 0.39 KB  |  views: 479  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //For Donncha's Sitewide Tags plugin: Populate tags blog with all posts made before the plugin was added
  2. $posts = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_status = 'publish'" );
  3. if ( !empty($posts) ) {
  4.     foreach ( $posts as $post ) {
  5.         $post_id = $post['ID'];
  6.         if($post_id != 1 && $post_id != 2)
  7.             sitewide_tags_post($post_id, get_post($post_id));
  8.     }
  9. }
clone this paste RAW Paste Data