A
A
Alexander Sobolev2021-07-23 15:15:15
WordPress
Alexander Sobolev, 2021-07-23 15:15:15

In which variable(s) are the ACF data stored?

Hello!
I want to take a date\time through an arbitrary field to schedule a recording. How to get it out?

add_action( 'wp_insert_post_data', 'cron_bike_event', 20, 2 );
function cron_bike_event( $data, $postarr ){

  if(	( empty( $_POST['post_type'] ) || 'bike_events' !== $_POST['post_type'] )
    ||	( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
    ||	( 'bike_events' !== get_current_screen()->id )
    ||	! current_user_can( 'edit_post', $postarr['ID'] ))
  return $data;

  $data['post_status'] = 'future';
  $data['post_date'] = //get_field('start_datatime');
  $data['post_date_gmt'] = //get_field('start_datatime');

  return $data;
}

WordPress database error: [Column 'post_date' cannot be null]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladik Bubin, 2021-07-23
@san_jorich

All answers here:
https://www.advancedcustomfields.com/resources/
https://wp-kama.ru/function/the_time

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question