wppaste
WordPress

Custom_Image_Header::ajax_header_add(): never

Since
3.9.0
Source
wp-admin/includes/class-custom-image-header.php:1460
Given an attachment ID for a header image, updates its "last used" timestamp to now.

Description

Triggered when the user tries adds a new header image from the Media Manager, even if s/he doesn't save that change.

Return

never

Uses · 7

Source

	public function ajax_header_add() {		check_ajax_referer( 'header-add', 'nonce' ); 		if ( ! current_user_can( 'edit_theme_options' ) ) {			wp_send_json_error();		} 		$attachment_id = absint( $_POST['attachment_id'] );		if ( $attachment_id < 1 ) {			wp_send_json_error();		} 		$key = '_wp_attachment_custom_header_last_used_' . get_stylesheet();		update_post_meta( $attachment_id, $key, time() );		update_post_meta( $attachment_id, '_wp_attachment_is_custom_header', get_stylesheet() ); 		wp_send_json_success();	}

History

Introduced in 3.9.0. One change between 6.7.7 and 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

7.1.0
Return type changed from none to never.verified against source
3.9.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-admin/includes/class-custom-image-header.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.