WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

Custom_Image_Header::get_previous_crop() public WP 4.9.0

Get the ID of a previous crop from the same base image.

Это метод класса: Custom_Image_Header{}

Хуков нет.

Возвращает

Число/false. An attachment ID if one exists. False if none.

Использование

$Custom_Image_Header = new Custom_Image_Header();
$Custom_Image_Header->get_previous_crop( $object );
$object(массив) (обязательный)
A crop attachment object.

Список изменений

С версии 4.9.0 Введена.

Код Custom_Image_Header::get_previous_crop() WP 5.5.1

wp-admin/includes/class-custom-image-header.php
<?php
public function get_previous_crop( $object ) {
	$header_images = $this->get_uploaded_header_images();

	// Bail early if there are no header images.
	if ( empty( $header_images ) ) {
		return false;
	}

	$previous = false;

	foreach ( $header_images as $image ) {
		if ( $image['attachment_parent'] === $object['post_parent'] ) {
			$previous = $image['attachment_id'];
			break;
		}
	}

	return $previous;
}