post_status) { case 'publish': return $this->displayContent($post); case 'private': if (current_user_can('read_private_posts')) { return $this->displayContent($post); } return ''; case 'draft': case 'pending': case 'future': if (current_user_can('edit_post', $post_id)) { return $this->displayContent($post); } return ''; default: return ''; } } function displayContent($post) { $blocks = parse_blocks($post->post_content); return render_block($blocks[0]); } }