Share Pastebin
Guest
Public paste!

MrBrian

By: a guest | Oct 10th, 2008 | Syntax: PHP | Size: 0.39 KB | Hits: 469 | Expires: Never
Copy text to clipboard
  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. }