Inpsyde\MultilingualPress\Widget\Dashboard\UntranslatedPosts\TranslationCompletedSettingUpdater::update_setting PHP Method

update_setting() public method

Updates the translation completed setting of the post with the given ID.
Since: 3.0.0
public update_setting ( integer $post_id, WP_Post $post ) : boolean
$post_id integer Post ID.
$post WP_Post Post object.
return boolean 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);
    }
TranslationCompletedSettingUpdater