public get_real_post_type ( WP_Post $post ) : string | ||
$post | WP_Post | |
return | string |
public function get_real_post_type(WP_Post $post)
{
if ('revision' !== $post->post_type) {
return $post->post_type;
}
if (empty($this->post_request_data['post_type'])) {
return $post->post_type;
}
if ('revision' === $this->post_request_data['post_type']) {
return $post->post_type;
}
if (is_string($this->post_request_data['post_type'])) {
// auto-draft
return $this->post_request_data['post_type'];
}
return $post->post_type;
}