SHARE
TWEET

MrBrian

a guest Oct 10th, 2008 480 Never
  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. }
RAW Paste Data
Top