[ Index ]

PHP Cross Reference of WordPress




/wp-admin/includes/ -> class-custom-image-header.php (summary)

The custom header image script.

File Size: 1600 lines (48 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Custom_Image_Header:: (36 methods):

Class: Custom_Image_Header  - X-Ref

The custom header image class.

__construct( $admin_header_callback, $admin_image_div_callback = '' )   X-Ref
Constructor - Register administration header callback.

since: 2.1.0
param: callable $admin_header_callback
param: callable $admin_image_div_callback Optional custom image div output callback.

init()   X-Ref
Set up the hooks for the Custom Header admin page.

since: 2.1.0

help()   X-Ref
Adds contextual help.

since: 3.0.0

step()   X-Ref
Get the current step.

since: 2.6.0
return: int Current step.

js_includes()   X-Ref
Set up the enqueue for the JavaScript files.

since: 2.1.0

css_includes()   X-Ref
Set up the enqueue for the CSS files

since: 2.7.0

take_action()   X-Ref
Execute custom header modification.

since: 2.6.0

process_default_headers()   X-Ref
Process the default headers

since: 3.0.0

show_header_selector( $type = 'default' )   X-Ref
Display UI for selecting one of several default headers.

Show the random image option if this theme has multiple header images.
Random image option is on by default if no header has been set.

since: 3.0.0
param: string $type The header type. One of 'default' (for the Uploaded Images control)

js()   X-Ref
Execute JavaScript depending on step.

since: 2.1.0

js_1()   X-Ref
Display JavaScript based on Step 1 and 3.

since: 2.6.0

pickColor(color)   X-Ref
No description

toggle_text()   X-Ref
No description

js_2()   X-Ref
Display JavaScript based on Step 2.

since: 2.6.0

onEndCrop( coords )   X-Ref
No description

step_1()   X-Ref
Display first step of custom header image page.

since: 2.1.0

step_2()   X-Ref
Display second step of custom header image page.

since: 2.1.0

step_2_manage_upload()   X-Ref
Upload the file to be cropped in the second step.

since: 3.4.0

step_3()   X-Ref
Display third step of custom header image page.

since: 2.1.0
since: 4.4.0 Switched to using wp_get_attachment_url() instead of the guid

finished()   X-Ref
Display last step of custom header image page.

since: 2.1.0

admin_page()   X-Ref
Display the page based on the current step.

since: 2.1.0

attachment_fields_to_edit( $form_fields )   X-Ref
Unused since 3.5.0.

since: 3.4.0
return: array $form_fields
param: array $form_fields

filter_upload_tabs( $tabs )   X-Ref
Unused since 3.5.0.

since: 3.4.0
return: array $tabs
param: array $tabs

set_header_image( $choice )   X-Ref
Choose a header image, selected from existing uploaded and default headers,
or provide an array of uploaded header data (either new, or from media library).

since: 3.4.0
param: mixed $choice Which header image to select. Allows for values of 'random-default-image',

remove_header_image()   X-Ref
Remove a header image.

since: 3.4.0

reset_header_image()   X-Ref
Reset a header image to the default image for the theme.

This method does not do anything if the theme does not have a default header image.

since: 3.4.0

get_header_dimensions( $dimensions )   X-Ref
Calculate width and height based on what the currently selected theme supports.

since: 3.9.0
return: array dst_height and dst_width of header image.
param: array $dimensions

create_attachment_object( $cropped, $parent_attachment_id )   X-Ref
Create an attachment 'object'.

since: 3.9.0
return: array An array with attachment object data.
param: string $cropped              Cropped image URL.
param: int    $parent_attachment_id Attachment ID of parent image.

insert_attachment( $attachment, $cropped )   X-Ref
Insert an attachment and its metadata.

since: 3.9.0
return: int Attachment ID.
param: array  $attachment An array with attachment object data.
param: string $cropped    File path to cropped image.

ajax_header_crop()   X-Ref
Gets attachment uploaded by Media Manager, crops it, then saves it as a
new object. Returns JSON-encoded object details.

since: 3.9.0

ajax_header_add()   X-Ref
Given an attachment ID for a header image, updates its "last used"
timestamp to now.

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

since: 3.9.0

ajax_header_remove()   X-Ref
Given an attachment ID for a header image, unsets it as a user-uploaded
header image for the active theme.

Triggered when the user clicks the overlay "X" button next to each image
choice in the Customizer's Header tool.

since: 3.9.0

customize_set_last_used( $wp_customize )   X-Ref
Updates the last-used postmeta on a header image attachment after saving a new header image via the Customizer.

since: 3.9.0
param: WP_Customize_Manager $wp_customize Customize manager.

get_default_header_images()   X-Ref
Gets the details of default header images if defined.

since: 3.9.0
return: array Default header images.

get_uploaded_header_images()   X-Ref
Gets the previously uploaded header images.

since: 3.9.0
return: array Uploaded header images.

get_previous_crop( $attachment )   X-Ref
Get the ID of a previous crop from the same base image.

since: 4.9.0
return: int|false An attachment ID if one exists. False if none.
param: array $attachment An array with a cropped attachment object data.

Generated: Fri Jul 19 01:00:02 2024 Cross-referenced by PHPXref 0.7.1