public function update_setting($post_id, WP_Post $post) { if (!$this->nonce->is_valid()) { return false; } if (!in_array($post->post_status, ['publish', 'draft'], true)) { return false; } $value = array_key_exists(PostRepository::META_KEY, $_POST) ? (bool) $_POST[PostRepository::META_KEY] : false; return $this->post_repository->update_post($post_id, $value); }