Yoast\WP\SEO\Context
Meta_Tags_Context::get_main_image_url_for_rest_request
Gets the main image URL for REST requests.
Метод класса: Meta_Tags_Context{}
Хуков нет.
Возвращает
Строку|null. The main image URL.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_main_image_url_for_rest_request();
Код Meta_Tags_Context::get_main_image_url_for_rest_request() Meta Tags Context::get main image url for rest request Yoast 26.5
private function get_main_image_url_for_rest_request() {
switch ( $this->page_type ) {
case 'Post_Type':
if ( $this->post instanceof WP_Post ) {
$url = $this->image->get_post_content_image( $this->post->ID );
if ( $url === '' ) {
return null;
}
return $url;
}
return null;
default:
return null;
}
}