Last active
August 29, 2015 14:15
-
-
Save setola/05d63243e8bee0dbec41 to your computer and use it in GitHub Desktop.
Revisions
-
setola revised this gist
Feb 20, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,5 +16,5 @@ //echo 'from: '.$art->post_date.' to: '.$date_r[$k][1].'<br>'; // just to be shure $art->post_date = $date_r[$k][1]; $art->post_date_gmt = $date_r[$k][0]; //wp_update_post($art); // enable this when you're sure :) } -
setola created this gist
Feb 20, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ <?php $articles = get_posts(array( 'post_type' => MY_CUSTOM_POST_TYPE, 'numberposts' => -1 )); $date = array(); foreach($articles as $art){ $date[] = array($art->post_date_gmt, $art->post_date); } $date_r = array_reverse($date); foreach($articles as $k => $art){ //echo 'from: '.$art->post_date.' to: '.$date_r[$k][1].'<br>'; // just to be shure $art->post_date = $date_r[$k][1]; $art->post_date_gmt = $date_r[$k][0]; //wp_update_post($art); // enable this when you're shure :) }