public function update_post($post_id, $value);
/** * Updates the translation completed setting of the post with the given ID. * * @since 3.0.0 * @wp-hook save_post * * @param int $post_id Post ID. * @param WP_Post $post Post object. * * @return bool Whether or not the translation completed setting was updated successfully. */ 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); }