ActionScheduler_wpPostStore::get_date_gmt()
Get Date GMT.
Метод класса: ActionScheduler_wpPostStore{}
Хуков нет.
Возвращает
ActionScheduler_DateTime
. The date the action is schedule to run, or the date that it ran.
Использование
$ActionScheduler_wpPostStore = new ActionScheduler_wpPostStore(); $ActionScheduler_wpPostStore->get_date_gmt( $action_id );
- $action_id(int) (обязательный)
- Action ID.
Код ActionScheduler_wpPostStore::get_date_gmt() ActionScheduler wpPostStore::get date gmt WC 7.7.0
public function get_date_gmt( $action_id ) { $post = get_post( $action_id ); if ( empty( $post ) || ( self::POST_TYPE !== $post->post_type ) ) { /* translators: %s is the action ID */ throw new InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) ); } if ( 'publish' === $post->post_status ) { return as_get_datetime_object( $post->post_modified_gmt ); } else { return as_get_datetime_object( $post->post_date_gmt ); } }