Skip to content

Instantly share code, notes, and snippets.

@mvaneijgen
Created October 20, 2016 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mvaneijgen/3158c2ef88d7585776bcaaeae1d2f804 to your computer and use it in GitHub Desktop.
Save mvaneijgen/3158c2ef88d7585776bcaaeae1d2f804 to your computer and use it in GitHub Desktop.
<?php
require_once 'wp-load.php';
$args = array(
'post_type' => 'foto_archief',
'posts_per_page' => -1
);
$items = get_posts( $args );
if ($items ) {
foreach( $items AS $item ) {
$myData = get_field("date", $item->ID);
update_field("date", $myData, $item->ID);
echo "Updated post with ID ".$item->ID."<br/>";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment