Guest User

Untitled

a guest
May 21st, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. $sql = mysql_query("
  2.         SELECT id
  3.         FROM fc_wp_posts
  4.         WHERE post_type = 'post'
  5.         AND post_status = 'publish'
  6.         ");
  7.        
  8.     while ($postname = mysql_fetch_array($sql)) {
  9.         $id = $postname['id'];
  10.        
  11.         $p = wp_update_post( $id );
  12.         $num++;
  13.         if ( is_wp_error( $p ) ) {
  14.         echo 'Encountered error: ' . $p->get_error_message();
  15.     } else {
  16.         echo '# ' . $num . ' | Successfully updated<br />';
  17.     }
  18.        
  19.     }
Add Comment
Please, Sign In to add comment