Inpsyde\MultilingualPress\Relations\Post\RelationshipController::get_real_post_type PHP Method

get_real_post_type() private method

This includes a workaround for auto-drafts.
private get_real_post_type ( WP_Post $post ) : string
$post WP_Post Post object.
return string Post type.
    private function get_real_post_type(WP_Post $post)
    {
        if ('revision' !== $post->post_type) {
            return $post->post_type;
        }
        if (empty($_POST['post_type']) || 'revision' === $_POST['post_type']) {
            return $post->post_type;
        }
        if (is_string($_POST['post_type'])) {
            return $_POST['post_type'];
        }
        return $post->post_type;
    }