Inpsyde\MultilingualPress\Relations\Post\RelationshipContext::new_post_id PHP Method

new_post_id() public method

Returns the new post ID.
Since: 3.0.0
public new_post_id ( ) : integer
return integer New post ID.
    public function new_post_id()
    {
        return (int) $this->data[self::KEY_NEW_POST_ID];
    }

Usage Example

 /**
  * Connects the current post with an existing remote one.
  *
  * @return bool Whether or not the relationship was updated successfully.
  */
 private function connect_existing_post()
 {
     $this->disconnect_post();
     return $this->content_relations->set_relation($this->context->source_site_id(), $this->context->remote_site_id(), $this->context->source_post_id(), $this->context->new_post_id(), 'post');
 }