public function getContentFromTitle(string $title, string $post_type = ''): array
    {
        $post = $this->getDriver()->content->get($title, ['by' => 'title', 'post_type' => $post_type]);

        return array(
            'id'   => (int) $post->ID,
            'slug' => $post->post_name,
            'url'  => $post->url,
        );
    }
public function getContentFromTitle(string $title, string $post_type = ''): array
    {
        $post = $this->getDriver()->content->get($title, ['by' => 'title', 'post_type' => $post_type]);

        return array(
            'id'   => (int) $post->ID,
            'slug' => $post->post_name,
            'url'  => $post->url,
        );
    }
public function getContentFromTitle ( string $ title , string $ post_type = '' ) : array { $ post = $ this -> getDriver ( ) -> content -> get ( $ title , [ 'by' => 'title' , 'post_type' => $ post_type ] ) ; return array ( 'id' => ( int ) $ post -> ID , 'slug' => $ post -> post_name , 'url' => $ post -> url , ) ; }
Get content from its title.

@param string $title     The title of the content to get.
@param string $post_type Post type(s) to consider when searching for the content.

@return array {
@type int    $id   Content ID.
@type string $slug Content slug.
@type string $url  Content url.
}
Get content from its title .