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