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

Custom_Image_Header::step_2_manage_upload() public WP 3.4.0

Upload the file to be cropped in the second step.

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

Хуков нет.

Возвращает

Null. Ничего.

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

$Custom_Image_Header = new Custom_Image_Header();
$Custom_Image_Header->step_2_manage_upload();

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

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

Код Custom_Image_Header::step_2_manage_upload() WP 5.5.1

wp-admin/includes/class-custom-image-header.php
<?php
public function step_2_manage_upload() {
	$overrides = array( 'test_form' => false );

	$uploaded_file = $_FILES['import'];
	$wp_filetype   = wp_check_filetype_and_ext( $uploaded_file['tmp_name'], $uploaded_file['name'] );
	if ( ! wp_match_mime_types( 'image', $wp_filetype['type'] ) ) {
		wp_die( __( 'The uploaded file is not a valid image. Please try again.' ) );
	}

	$file = wp_handle_upload( $uploaded_file, $overrides );

	if ( isset( $file['error'] ) ) {
		wp_die( $file['error'], __( 'Image Upload Error' ) );
	}

	$url      = $file['url'];
	$type     = $file['type'];
	$file     = $file['file'];
	$filename = wp_basename( $file );

	// Construct the object array.
	$object = array(
		'post_title'     => $filename,
		'post_content'   => $url,
		'post_mime_type' => $type,
		'guid'           => $url,
		'context'        => 'custom-header',
	);

	// Save the data.
	$attachment_id = wp_insert_attachment( $object, $file );
	return compact( 'attachment_id', 'file', 'filename', 'url', 'type' );
}