Uses
Uses | Description |
---|---|
wp-admin/includes/class-custom-image-header.php: Custom_Image_Header::get_uploaded_header_images() | Gets the previously uploaded header images. |
Get the ID of a previous crop from the same base image.
(array) (Required) A crop attachment object.
(int|false) An attachment ID if one exists. False if none.
File: wp-admin/includes/class-custom-image-header.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; }
Version | Description |
---|---|
4.9.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/custom_image_header/get_previous_crop