Yoast\WP\SEO\Context

Meta_Tags_Context::get_main_image_id_for_rest_request()privateYoast 1.0

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() Yoast 24.4

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;
	}
}