[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/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):
  __construct()
  init()
  help()
  step()
  js_includes()
  css_includes()
  take_action()
  process_default_headers()
  show_header_selector()
  js()
  js_1()
  pickColor()
  toggle_text()
  js_2()
  onEndCrop()
  step_1()
  step_2()
  step_2_manage_upload()
  step_3()
  finished()
  admin_page()
  attachment_fields_to_edit()
  filter_upload_tabs()
  set_header_image()
  remove_header_image()
  reset_header_image()
  get_header_dimensions()
  create_attachment_object()
  insert_attachment()
  ajax_header_crop()
  ajax_header_add()
  ajax_header_remove()
  customize_set_last_used()
  get_default_header_images()
  get_uploaded_header_images()
  get_previous_crop()


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.

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

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.

return: int Current step.
since: 2.6.0

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.

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

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.

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

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

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

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).

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

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.

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

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

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

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

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

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.

param: WP_Customize_Manager $wp_customize Customize manager.
since: 3.9.0

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

return: array Default header images.
since: 3.9.0

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

return: array Uploaded header images.
since: 3.9.0

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

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



Generated: Sat Apr 27 01:00:02 2024 Cross-referenced by PHPXref 0.7.1