Yoast\WP\SEO\Builders
Indexable_Link_Builder::get_post_id() protected Yoast 1.0
Get the post ID based on the link's type and its target's permalink.
{} Это метод класса: Indexable_Link_Builder{}
Хуков нет.
Возвращает
Число. The post ID.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_post_id( $type, $permalink );
- $type(строка) (обязательный)
- The type of link (either SEO_Links::TYPE_INTERNAL or SEO_Links::TYPE_INTERNAL_IMAGE).
- $permalink(строка) (обязательный)
- The permalink of the link's target.
Код Indexable_Link_Builder::get_post_id() Indexable Link Builder::get post id Yoast 15.7
protected function get_post_id( $type, $permalink ) {
if ( $type === SEO_Links::TYPE_INTERNAL ) {
return \url_to_postid( $permalink );
}
return $this->image_helper->get_attachment_by_url( $permalink );
}