Yoast\WP\SEO\Builders
Indexable_Post_Builder::get_permalink()
Retrieves the permalink for a post with the given post type and ID.
Метод класса: Indexable_Post_Builder{}
Хуков нет.
Возвращает
WP_Error|Строку|false
. The permalink.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_permalink( $post_type, $post_id );
- $post_type(строка) (обязательный)
- The post type.
- $post_id(int) (обязательный)
- The post ID.
Код Indexable_Post_Builder::get_permalink() Indexable Post Builder::get permalink Yoast 24.9
protected function get_permalink( $post_type, $post_id ) { if ( $post_type !== 'attachment' ) { return \get_permalink( $post_id ); } return \wp_get_attachment_url( $post_id ); }