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

Custom_Image_Header::customize_set_last_used() public WP 3.9.0

Updates the last-used postmeta on a header image attachment after saving a new header image via the Customizer.

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

Хуков нет.

Возвращает

Null. Ничего.

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

$Custom_Image_Header = new Custom_Image_Header();
$Custom_Image_Header->customize_set_last_used( $wp_customize );
$wp_customize(WP_Customize_Manager) (обязательный)
Customize manager.

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

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

Код Custom_Image_Header::customize_set_last_used() WP 5.5.1

wp-admin/includes/class-custom-image-header.php
<?php
public function customize_set_last_used( $wp_customize ) {

	$header_image_data_setting = $wp_customize->get_setting( 'header_image_data' );
	if ( ! $header_image_data_setting ) {
		return;
	}
	$data = $header_image_data_setting->post_value();

	if ( ! isset( $data['attachment_id'] ) ) {
		return;
	}

	$attachment_id = $data['attachment_id'];
	$key           = '_wp_attachment_custom_header_last_used_' . get_stylesheet();
	update_post_meta( $attachment_id, $key, time() );
}