protected function prepare_post_info($pid = 0) { if (is_string($pid) || is_numeric($pid) || is_object($pid) && !isset($pid->post_title) || $pid === 0) { $pid = self::check_post_id($pid); $post = get_post($pid); if ($post) { return $post; } } //we can skip if already is WP_Post return $pid; }