Yoast\WP\SEO\Integrations\Front_End
RSS_Footer_Embed::get_replace_vars() protected Yoast 1.0
Retrieves the replacement variables.
{} Это метод класса: RSS_Footer_Embed{}
Хуков нет.
Возвращает
Массив. The replacement variables.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_replace_vars( $link_template, $post );
- $link_template(строка) (обязательный)
- The link template.
- $post(смешанный) (обязательный)
- The post to use.
Код RSS_Footer_Embed::get_replace_vars() RSS Footer Embed::get replace vars Yoast 15.6.2
protected function get_replace_vars( $link_template, $post ) {
$author_link = '';
if ( \is_object( $post ) ) {
$author_link = \sprintf( $link_template, \esc_url( \get_author_posts_url( $post->post_author ) ), \esc_html( \get_the_author() ) );
}
return [
'%%AUTHORLINK%%' => $author_link,
'%%POSTLINK%%' => \sprintf( $link_template, \esc_url( \get_permalink() ), \esc_html( \get_the_title() ) ),
'%%BLOGLINK%%' => \sprintf( $link_template, \esc_url( \get_bloginfo( 'url' ) ), \esc_html( \get_bloginfo( 'name' ) ) ),
'%%BLOGDESCLINK%%' => \sprintf( $link_template, \esc_url( \get_bloginfo( 'url' ) ), \esc_html( \get_bloginfo( 'name' ) ) . ' - ' . \esc_html( \get_bloginfo( 'description' ) ) ),
];
}