Inpsyde\MultilingualPress\Relations\Post\RelationshipController::disconnect_post PHP Method

disconnect_post() private method

Disconnects the current post with the one given in the request.
private disconnect_post ( ) : void
return void
    private function disconnect_post()
    {
        $remote_site_id = $this->context->remote_site_id();
        $remote_post_id = $this->context->remote_post_id();
        $source_site_id = $this->context->source_site_id();
        $translation_ids = $this->content_relations->get_translation_ids($this->context->source_site_id(), $remote_site_id, $this->context->source_post_id(), $remote_post_id, 'post');
        if ($translation_ids['ml_source_blogid'] !== $source_site_id) {
            $remote_site_id = $source_site_id;
            if (0 !== $remote_post_id) {
                $remote_post_id = $this->context->source_post_id();
            }
        }
        $this->content_relations->delete_relation($translation_ids['ml_source_blogid'], $remote_site_id, $translation_ids['ml_source_elementid'], $remote_post_id, 'post');
    }