Tribe__Events__Aggregator__Record__Abstract::set_status( string $status )
Sets a status on the record
Contents
Parameters
- $status
-
(string) (Required) Status to set.
Return
(int)
Source
File: src/Tribe/Aggregator/Record/Abstract.php
public function set_status( $status ) {
if ( ! isset( Tribe__Events__Aggregator__Records::$status->{ $status } ) ) {
return false;
}
$status = wp_update_post( array(
'ID' => $this->id,
'post_status' => Tribe__Events__Aggregator__Records::$status->{ $status },
) );
if ( ! is_wp_error( $status ) && ! empty( $this->post->post_parent ) ) {
$status = wp_update_post( array(
'ID' => $this->post->post_parent,
'post_modified' => date( Tribe__Date_Utils::DBDATETIMEFORMAT, current_time( 'timestamp' ) ),
) );
}
return $status;
}