Got an iPhone or iPad? We have a brand new Pastebin App for both devices, and it's totally free! Click here to download the new Pastebin App for iOS.
Guest

Colas Nahaboo

By: a guest on Nov 6th, 2008  |  syntax: PHP  |  size: 0.37 KB  |  hits: 839  |  expires: Never
download  |  raw  |  embed  |  report abuse
This paste has a previous version, view the difference. Copied
  1. // For Donncha's Sitewide Tags plugin: Populate tags blog with all posts made before the plugin was added
  2. // Working version
  3. $posts = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_status = 'publish'" );
  4. if ( !empty($posts) ) {
  5.     foreach ( $posts as $post ) {
  6.         if($post != 1 && $post != 2)
  7.             sitewide_tags_post($post, get_post($post));
  8.     }
  9. }