Just to clarify, use date('Ymd')
not date(‘YYYYMMDD’)
Well.. I decided to just run an init query through every post and add the field values back into themselves. Here’s a snippet of what I used: (add once to functions, refresh /wp-admin, delete code)
function process_post() {
$my_posts = get_posts( array('post_type' => 'page', 'posts_per_page' => -1 ) );
foreach ( $my_posts as $my_post ) :
$value = get_field('field_560094b2af64e', $my_post->ID );
if($value):
update_field( 'field_560094b2af64e', $value, $my_post );
endif;
endforeach;
}
add_action( 'init', 'process_post' );
In your callback you can add an empty wp_update_post()
Example:
wp_update_post( array('ID' => $post_id) );
Bashed my head over this for most of today. Finally got it to work.
I was limiting roles from accessing the backend.
function restrict_admin()
{
if ( ! current_user_can( 'update_core' ) && '/wp-admin/admin-ajax.php' != $_SERVER['PHP_SELF'] ) {
wp_redirect( site_url('/apply') );
}
}
add_action( 'admin_init', 'restrict_admin', 1 );
This conflicted with the AJAX of the image uploader. Check your theme’s function.php and plugins to see if there is any similar conflict.