[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/ -> class-wp-customize-manager.php (summary)

WordPress Customize Manager classes

File Size: 6121 lines (202 kb)
Included or required: 2 times
Referenced: 0 times
Includes or requires: 37 files
 wp-includes/customize/class-wp-customize-nav-menu-location-control.php
 wp-includes/customize/class-wp-customize-nav-menu-item-setting.php
 wp-includes/customize/class-wp-customize-site-icon-control.php
 wp-includes/customize/class-wp-customize-background-image-setting.php
 wp-includes/customize/class-wp-customize-nav-menu-item-control.php
 wp-includes/customize/class-wp-customize-nav-menu-setting.php
 wp-includes/customize/class-wp-widget-form-customize-control.php
 wp-includes/customize/class-wp-customize-sidebar-section.php
 wp-includes/customize/class-wp-widget-area-customize-control.php
 wp-includes/customize/class-wp-customize-header-image-setting.php
 wp-includes/class-wp-customize-section.php
 wp-includes/customize/class-wp-customize-themes-panel.php
 wp-includes/customize/class-wp-customize-nav-menu-control.php
 wp-includes/class-wp-customize-widgets.php
 wp-includes/customize/class-wp-customize-media-control.php
 wp-includes/customize/class-wp-customize-filter-setting.php
 wp-includes/customize/class-wp-customize-background-image-control.php
 wp-includes/customize/class-wp-customize-cropped-image-control.php
 wp-includes/customize/class-wp-customize-nav-menu-auto-add-control.php
 wp-includes/customize/class-wp-customize-header-image-control.php
 wp-includes/class-wp-customize-control.php
 wp-includes/customize/class-wp-customize-themes-section.php
 wp-includes/customize/class-wp-customize-nav-menus-panel.php
 wp-includes/class-wp-customize-panel.php
 wp-includes/customize/class-wp-customize-theme-control.php
 wp-includes/customize/class-wp-customize-image-control.php
 wp-includes/class-wp-customize-setting.php
 wp-includes/customize/class-wp-customize-upload-control.php
 wp-includes/class-wp-customize-nav-menus.php
 wp-includes/customize/class-wp-customize-background-position-control.php
 wp-includes/customize/class-wp-customize-nav-menu-name-control.php
 wp-includes/customize/class-wp-customize-color-control.php
 wp-includes/customize/class-wp-customize-custom-css-setting.php
 wp-includes/customize/class-wp-customize-code-editor-control.php
 wp-includes/customize/class-wp-customize-selective-refresh.php
 wp-includes/customize/class-wp-customize-nav-menu-section.php
 wp-includes/customize/class-wp-customize-nav-menu-locations-control.php

Defines 117 functions

  __construct()
  doing_ajax()
  wp_die()
  wp_die_handler()
  setup_theme()
  establish_loaded_changeset()
  after_setup_theme()
  start_previewing_theme()
  stop_previewing_theme()
  settings_previewed()
  autosaved()
  branching()
  changeset_uuid()
  theme()
  settings()
  controls()
  containers()
  sections()
  panels()
  is_theme_active()
  wp_loaded()
  wp_redirect_status()
  find_changeset_post_id()
  get_changeset_posts()
  dismiss_user_auto_draft_changesets()
  changeset_post_id()
  get_changeset_post_data()
  changeset_data()
  import_theme_starter_content()
  prepare_starter_content_attachments()
  _save_starter_content_changeset()
  unsanitized_post_values()
  post_value()
  set_post_value()
  customize_preview_init()
  filter_iframe_security_headers()
  add_state_query_params()
  customize_preview_override_404_status()
  customize_preview_base()
  customize_preview_html5()
  customize_preview_loading_style()
  remove_frameless_preview_messenger_channel()
  customize_preview_settings()
  customize_preview_signature()
  remove_preview_signature()
  is_preview()
  get_template()
  get_stylesheet()
  get_template_root()
  get_stylesheet_root()
  current_theme()
  validate_setting_values()
  prepare_setting_validity_for_js()
  save()
  save_changeset_post()
  preserve_insert_changeset_post_content()
  trash_changeset_post()
  handle_changeset_trash_request()
  grant_edit_post_capability_for_changeset()
  set_changeset_lock()
  refresh_changeset_lock()
  add_customize_screen_to_heartbeat_settings()
  get_lock_user_data()
  check_changeset_lock_with_heartbeat()
  handle_override_changeset_lock_request()
  _filter_revision_post_has_changed()
  _publish_changeset_values()
  update_stashed_theme_mod_settings()
  refresh_nonces()
  handle_dismiss_autosave_or_lock_request()
  add_setting()
  add_dynamic_settings()
  get_setting()
  remove_setting()
  add_panel()
  get_panel()
  remove_panel()
  register_panel_type()
  render_panel_templates()
  add_section()
  get_section()
  remove_section()
  register_section_type()
  render_section_templates()
  add_control()
  get_control()
  remove_control()
  register_control_type()
  render_control_templates()
  _cmp_priority()
  prepare_controls()
  enqueue_control_scripts()
  is_ios()
  get_document_title_template()
  set_preview_url()
  get_preview_url()
  is_cross_domain()
  get_allowed_urls()
  get_messenger_channel()
  set_return_url()
  get_return_url()
  set_autofocus()
  get_autofocus()
  get_nonces()
  customize_pane_settings()
  get_previewable_devices()
  register_controls()
  has_published_pages()
  register_dynamic_settings()
  handle_load_themes_request()
  _sanitize_header_textcolor()
  _sanitize_background_setting()
  export_header_video_settings()
  _validate_header_video()
  _validate_external_header_video()
  _sanitize_external_header_video()
  _render_custom_logo_partial()

Functions
Functions that are not part of a class:

__construct( $args = array()   X-Ref
Constructor.

param: array $args {
since: 3.4.0
since: 4.7.0 Added `$args` parameter.

doing_ajax( $action = null )   X-Ref
Returns true if it's an Ajax request.

return: bool True if it's an Ajax request, false otherwise.
param: string|null $action Whether the supplied Ajax action is being run.
since: 3.4.0
since: 4.2.0 Added `$action` param.

wp_die( $ajax_message, $message = null )   X-Ref
Custom wp_die wrapper. Returns either the standard message for UI
or the Ajax message.

param: string|WP_Error $ajax_message Ajax return.
param: string          $message      Optional. UI message.
since: 3.4.0

wp_die_handler()   X-Ref
Returns the Ajax wp_die() handler if it's a customized request.

return: callable Die handler.
since: 3.4.0

setup_theme()   X-Ref
Starts preview and customize theme.

Check if customize query variable exist. Init filters to filter the active theme.

since: 3.4.0

establish_loaded_changeset()   X-Ref
Establishes the loaded changeset.

This method runs right at after_setup_theme and applies the 'customize_changeset_branching' filter to determine
whether concurrent changesets are allowed. Then if the Customizer is not initialized with a `changeset_uuid` param,
this method will determine which UUID should be used. If changeset branching is disabled, then the most saved
changeset will be loaded by default. Otherwise, if there are no existing saved changesets or if changeset branching is
enabled, then a new UUID will be generated.

since: 4.9.0

after_setup_theme()   X-Ref
Callback to validate a theme once it is loaded

since: 3.4.0

start_previewing_theme()   X-Ref
If the theme to be previewed isn't the active theme, add filter callbacks
to swap it out at runtime.

since: 3.4.0

stop_previewing_theme()   X-Ref
Stops previewing the selected theme.

Removes filters to change the active theme.

since: 3.4.0

settings_previewed()   X-Ref
Gets whether settings are or will be previewed.

return: bool
since: 4.9.0

autosaved()   X-Ref
Gets whether data from a changeset's autosaved revision should be loaded if it exists.

return: bool Is using autosaved changeset revision.
since: 4.9.0

branching()   X-Ref
Whether the changeset branching is allowed.

return: bool Is changeset branching.
since: 4.9.0

changeset_uuid()   X-Ref
Gets the changeset UUID.

return: string UUID.
since: 4.7.0

theme()   X-Ref
Gets the theme being customized.

return: WP_Theme
since: 3.4.0

settings()   X-Ref
Gets the registered settings.

return: array
since: 3.4.0

controls()   X-Ref
Gets the registered controls.

return: array
since: 3.4.0

containers()   X-Ref
Gets the registered containers.

return: array
since: 4.0.0

sections()   X-Ref
Gets the registered sections.

return: array
since: 3.4.0

panels()   X-Ref
Gets the registered panels.

return: array Panels.
since: 4.0.0

is_theme_active()   X-Ref
Checks if the current theme is active.

return: bool
since: 3.4.0

wp_loaded()   X-Ref
Registers styles/scripts and initialize the preview of each setting

since: 3.4.0

wp_redirect_status( $status )   X-Ref
Prevents Ajax requests from following redirects when previewing a theme
by issuing a 200 response instead of a 30x.

Instead, the JS will sniff out the location header.

return: int
param: int $status Status.
since: 3.4.0

find_changeset_post_id( $uuid )   X-Ref
Finds the changeset post ID for a given changeset UUID.

return: int|null Returns post ID on success and null on failure.
param: string $uuid Changeset UUID.
since: 4.7.0

get_changeset_posts( $args = array()   X-Ref
Gets changeset posts.

return: WP_Post[] Auto-draft changesets.
param: array $args {
since: 4.9.0

dismiss_user_auto_draft_changesets()   X-Ref
Dismisses all of the current user's auto-drafts (other than the present one).

return: int The number of auto-drafts that were dismissed.
since: 4.9.0

changeset_post_id()   X-Ref
Gets the changeset post ID for the loaded changeset.

return: int|null Post ID on success or null if there is no post yet saved.
since: 4.7.0

get_changeset_post_data( $post_id )   X-Ref
Gets the data stored in a changeset post.

return: array|WP_Error Changeset data or WP_Error on error.
param: int $post_id Changeset post ID.
since: 4.7.0

changeset_data()   X-Ref
Gets changeset data.

return: array Changeset data.
since: 4.7.0
since: 4.9.0 This will return the changeset's data with a user's autosave revision merged on top, if one exists and $autosaved is true.

import_theme_starter_content( $starter_content = array()   X-Ref
Imports theme starter content into the customized state.

param: array $starter_content Starter content. Defaults to `get_theme_starter_content()`.
since: 4.7.0

prepare_starter_content_attachments( $attachments )   X-Ref
Prepares starter content attachments.

Ensure that the attachments are valid and that they have slugs and file name/path.

return: array Prepared attachments.
param: array $attachments Attachments.
since: 4.7.0

_save_starter_content_changeset()   X-Ref
Saves starter content changeset.

since: 4.7.0

unsanitized_post_values( $args = array()   X-Ref
Gets dirty pre-sanitized setting values in the current customized state.

The returned array consists of a merge of three sources:
1. If the theme is not currently active, then the base array is any stashed
theme mods that were modified previously but never published.
2. The values from the current changeset, if it exists.
3. If the user can customize, the values parsed from the incoming
`$_POST['customized']` JSON data.
4. Any programmatically-set post values via `WP_Customize_Manager::set_post_value()`.

The name "unsanitized_post_values" is a carry-over from when the customized
state was exclusively sourced from `$_POST['customized']`. Nevertheless,
the value returned will come from the current changeset post and from the
incoming post data.

return: array
param: array $args {
since: 4.1.1
since: 4.7.0 Added `$args` parameter and merging with changeset values and stashed theme mods.

post_value( $setting, $default_value = null )   X-Ref
Returns the sanitized value for a given setting from the current customized state.

The name "post_value" is a carry-over from when the customized state was exclusively
sourced from `$_POST['customized']`. Nevertheless, the value returned will come
from the current changeset post and from the incoming post data.

return: string|mixed Sanitized value or the `$default_value` provided.
param: WP_Customize_Setting $setting       A WP_Customize_Setting derived object.
param: mixed                $default_value Value returned if `$setting` has no post value (added in 4.2.0)
since: 3.4.0
since: 4.1.1 Introduced the `$default_value` parameter.
since: 4.6.0 `$default_value` is now returned early when the setting post value is invalid.

set_post_value( $setting_id, $value )   X-Ref
Overrides a setting's value in the current customized state.

The name "post_value" is a carry-over from when the customized state was
exclusively sourced from `$_POST['customized']`.

param: string $setting_id ID for the WP_Customize_Setting instance.
param: mixed  $value      Post value.
since: 4.2.0

customize_preview_init()   X-Ref
Prints JavaScript settings.

since: 3.4.0

filter_iframe_security_headers( $headers )   X-Ref
Filters the X-Frame-Options and Content-Security-Policy headers to ensure frontend can load in customizer.

return: array Headers.
param: array $headers Headers.
since: 4.7.0

add_state_query_params( $url )   X-Ref
Adds customize state query params to a given URL if preview is allowed.

return: string URL.
param: string $url URL.
since: 4.7.0

customize_preview_override_404_status()   X-Ref
Prevents sending a 404 status when returning the response for the customize
preview, since it causes the jQuery Ajax to fail. Send 200 instead.

since: 4.0.0

customize_preview_base()   X-Ref
Prints base element for preview frame.

since: 3.4.0

customize_preview_html5()   X-Ref
Prints a workaround to handle HTML5 tags in IE < 9.

since: 3.4.0

customize_preview_loading_style()   X-Ref
Prints CSS for loading indicators for the Customizer preview.

since: 4.2.0

remove_frameless_preview_messenger_channel()   X-Ref
Removes customize_messenger_channel query parameter from the preview window when it is not in an iframe.

This ensures that the admin bar will be shown. It also ensures that link navigation will
work as expected since the parent frame is not being sent the URL to navigate to.

since: 4.7.0

customize_preview_settings()   X-Ref
Prints JavaScript settings for preview frame.

since: 3.4.0

customize_preview_signature()   X-Ref
Prints a signature so we can ensure the Customizer was properly executed.

since: 3.4.0

remove_preview_signature( $callback = null )   X-Ref
Removes the signature in case we experience a case where the Customizer was not properly executed.

return: callable|null Value passed through for {@see 'wp_die_handler'} filter.
param: callable|null $callback Optional. Value passed through for {@see 'wp_die_handler'} filter.
since: 3.4.0

is_preview()   X-Ref
Determines whether it is a theme preview or not.

return: bool True if it's a preview, false if not.
since: 3.4.0

get_template()   X-Ref
Retrieves the template name of the previewed theme.

return: string Template name.
since: 3.4.0

get_stylesheet()   X-Ref
Retrieves the stylesheet name of the previewed theme.

return: string Stylesheet name.
since: 3.4.0

get_template_root()   X-Ref
Retrieves the template root of the previewed theme.

return: string Theme root.
since: 3.4.0

get_stylesheet_root()   X-Ref
Retrieves the stylesheet root of the previewed theme.

return: string Theme root.
since: 3.4.0

current_theme( $current_theme )   X-Ref
Filters the active theme and return the name of the previewed theme.

return: string Theme name.
param: mixed $current_theme {@internal Parameter is not used}
since: 3.4.0

validate_setting_values( $setting_values, $options = array()   X-Ref
Validates setting values.

Validation is skipped for unregistered settings or for values that are
already null since they will be skipped anyway. Sanitization is applied
to values that pass validation, and values that become null or `WP_Error`
after sanitizing are marked invalid.

return: array Mapping of setting IDs to return value of validate method calls, either `true` or `WP_Error`.
param: array $setting_values Mapping of setting IDs to values to validate and sanitize.
param: array $options {
since: 4.6.0

prepare_setting_validity_for_js( $validity )   X-Ref
Prepares setting validity for exporting to the client (JS).

Converts `WP_Error` instance into array suitable for passing into the
`wp.customize.Notification` JS model.

return: true|array If `$validity` was a WP_Error, the error codes will be array-mapped
param: true|WP_Error $validity Setting validity.
since: 4.6.0

save()   X-Ref
Handles customize_save WP Ajax request to save/update a changeset.

since: 3.4.0
since: 4.7.0 The semantics of this method have changed to update a changeset, optionally to also change the status and other attributes.

save_changeset_post( $args = array()   X-Ref
Saves the post for the loaded changeset.

return: array|WP_Error Returns array on success and WP_Error with array data on error.
param: array $args {
since: 4.7.0

preserve_insert_changeset_post_content( $data, $postarr, $unsanitized_postarr )   X-Ref
Preserves the initial JSON post_content passed to save into the post.

This is needed to prevent KSES and other {@see 'content_save_pre'} filters
from corrupting JSON data.

Note that WP_Customize_Manager::validate_setting_values() have already
run on the setting values being serialized as JSON into the post content
so it is pre-sanitized.

Also, the sanitization logic is re-run through the respective
WP_Customize_Setting::sanitize() method when being read out of the
changeset, via WP_Customize_Manager::post_value(), and this sanitized
value will also be sent into WP_Customize_Setting::update() for
persisting to the DB.

Multiple users can collaborate on a single changeset, where one user may
have the unfiltered_html capability but another may not. A user with
unfiltered_html may add a script tag to some field which needs to be kept
intact even when another user updates the changeset to modify another field
when they do not have unfiltered_html.

return: array Filtered post data.
param: array $data                An array of slashed and processed post data.
param: array $postarr             An array of sanitized (and slashed) but otherwise unmodified post data.
param: array $unsanitized_postarr An array of slashed yet *unsanitized* and unprocessed post data as originally passed to wp_insert_post().
since: 5.4.1

trash_changeset_post( $post )   X-Ref
Trashes or deletes a changeset post.

The following re-formulates the logic from `wp_trash_post()` as done in
`wp_publish_post()`. The reason for bypassing `wp_trash_post()` is that it
will mutate the the `post_content` and the `post_name` when they should be
untouched.

return: mixed A WP_Post object for the trashed post or an empty value on failure.
param: int|WP_Post $post The changeset post.
since: 4.9.0

handle_changeset_trash_request()   X-Ref
Handles request to trash a changeset.

since: 4.9.0

grant_edit_post_capability_for_changeset( $caps, $cap, $user_id, $args )   X-Ref
Re-maps 'edit_post' meta cap for a customize_changeset post to be the same as 'customize' maps.

There is essentially a "meta meta" cap in play here, where 'edit_post' meta cap maps to
the 'customize' meta cap which then maps to 'edit_theme_options'. This is currently
required in core for `wp_create_post_autosave()` because it will call
`_wp_translate_postdata()` which in turn will check if a user can 'edit_post', but the
the caps for the customize_changeset post type are all mapping to the meta capability.
This should be able to be removed once #40922 is addressed in core.

return: array Capabilities.
param: string[] $caps    Array of the user's capabilities.
param: string   $cap     Capability name.
param: int      $user_id The user ID.
param: array    $args    Adds the context to the cap. Typically the object ID.
since: 4.9.0

set_changeset_lock( $changeset_post_id, $take_over = false )   X-Ref
Marks the changeset post as being currently edited by the current user.

param: int  $changeset_post_id Changeset post ID.
param: bool $take_over Whether to take over the changeset. Default false.
since: 4.9.0

refresh_changeset_lock( $changeset_post_id )   X-Ref
Refreshes changeset lock with the current time if current user edited the changeset before.

param: int $changeset_post_id Changeset post ID.
since: 4.9.0

add_customize_screen_to_heartbeat_settings( $settings )   X-Ref
Filters heartbeat settings for the Customizer.

return: array Heartbeat settings.
param: array $settings Current settings to filter.
since: 4.9.0

get_lock_user_data( $user_id )   X-Ref
Gets lock user data.

return: array|null User data formatted for client.
param: int $user_id User ID.
since: 4.9.0

check_changeset_lock_with_heartbeat( $response, $data, $screen_id )   X-Ref
Checks locked changeset with heartbeat API.

return: array The Heartbeat response.
param: array  $response  The Heartbeat response.
param: array  $data      The $_POST data sent.
param: string $screen_id The screen id.
since: 4.9.0

handle_override_changeset_lock_request()   X-Ref
Removes changeset lock when take over request is sent via Ajax.

since: 4.9.0

_filter_revision_post_has_changed( $post_has_changed, $last_revision, $post )   X-Ref
Filters whether a changeset has changed to create a new revision.

Note that this will not be called while a changeset post remains in auto-draft status.

return: bool Whether a revision should be made.
param: bool    $post_has_changed Whether the post has changed.
param: WP_Post $last_revision    The last revision post object.
param: WP_Post $post             The post object.
since: 4.7.0

_publish_changeset_values( $changeset_post_id )   X-Ref
Publishes the values of a changeset.

This will publish the values contained in a changeset, even changesets that do not
correspond to current manager instance. This is called by
`_wp_customize_publish_changeset()` when a customize_changeset post is
transitioned to the `publish` status. As such, this method should not be
called directly and instead `wp_publish_post()` should be used.

Please note that if the settings in the changeset are for a non-activated
theme, the theme must first be switched to (via `switch_theme()`) before
invoking this method.

return: true|WP_Error True or error info.
param: int $changeset_post_id ID for customize_changeset post. Defaults to the changeset for the current manager instance.
since: 4.7.0

update_stashed_theme_mod_settings( $inactive_theme_mod_settings )   X-Ref
Updates stashed theme mod settings.

return: array|false Returns array of updated stashed theme mods or false if the update failed or there were no changes.
param: array $inactive_theme_mod_settings Mapping of stylesheet to arrays of theme mod settings.
since: 4.7.0

refresh_nonces()   X-Ref
Refreshes nonces for the current preview.

since: 4.2.0

handle_dismiss_autosave_or_lock_request()   X-Ref
Deletes a given auto-draft changeset or the autosave revision for a given changeset or delete changeset lock.

since: 4.9.0

add_setting( $id, $args = array()   X-Ref
Adds a customize setting.

return: WP_Customize_Setting The instance of the setting that was added.
param: WP_Customize_Setting|string $id   Customize Setting object, or ID.
param: array                       $args Optional. Array of properties for the new Setting object.
since: 3.4.0
since: 4.5.0 Return added WP_Customize_Setting instance.

add_dynamic_settings( $setting_ids )   X-Ref
Registers any dynamically-created settings, such as those from $_POST['customized']
that have no corresponding setting created.

This is a mechanism to "wake up" settings that have been dynamically created
on the front end and have been sent to WordPress in `$_POST['customized']`. When WP
loads, the dynamically-created settings then will get created and previewed
even though they are not directly created statically with code.

return: array The WP_Customize_Setting objects added.
param: array $setting_ids The setting IDs to add.
since: 4.2.0

get_setting( $id )   X-Ref
Retrieves a customize setting.

return: WP_Customize_Setting|void The setting, if set.
param: string $id Customize Setting ID.
since: 3.4.0

remove_setting( $id )   X-Ref
Removes a customize setting.

Note that removing the setting doesn't destroy the WP_Customize_Setting instance or remove its filters.

param: string $id Customize Setting ID.
since: 3.4.0

add_panel( $id, $args = array()   X-Ref
Adds a customize panel.

return: WP_Customize_Panel The instance of the panel that was added.
param: WP_Customize_Panel|string $id   Customize Panel object, or ID.
param: array                     $args Optional. Array of properties for the new Panel object.
since: 4.0.0
since: 4.5.0 Return added WP_Customize_Panel instance.

get_panel( $id )   X-Ref
Retrieves a customize panel.

return: WP_Customize_Panel|void Requested panel instance, if set.
param: string $id Panel ID to get.
since: 4.0.0

remove_panel( $id )   X-Ref
Removes a customize panel.

Note that removing the panel doesn't destroy the WP_Customize_Panel instance or remove its filters.

param: string $id Panel ID to remove.
since: 4.0.0

register_panel_type( $panel )   X-Ref
Registers a customize panel type.

Registered types are eligible to be rendered via JS and created dynamically.

param: string $panel Name of a custom panel which is a subclass of WP_Customize_Panel.
since: 4.3.0

render_panel_templates()   X-Ref
Renders JS templates for all registered panel types.

since: 4.3.0

add_section( $id, $args = array()   X-Ref
Adds a customize section.

return: WP_Customize_Section The instance of the section that was added.
param: WP_Customize_Section|string $id   Customize Section object, or ID.
param: array                       $args Optional. Array of properties for the new Section object.
since: 3.4.0
since: 4.5.0 Return added WP_Customize_Section instance.

get_section( $id )   X-Ref
Retrieves a customize section.

return: WP_Customize_Section|void The section, if set.
param: string $id Section ID.
since: 3.4.0

remove_section( $id )   X-Ref
Removes a customize section.

Note that removing the section doesn't destroy the WP_Customize_Section instance or remove its filters.

param: string $id Section ID.
since: 3.4.0

register_section_type( $section )   X-Ref
Registers a customize section type.

Registered types are eligible to be rendered via JS and created dynamically.

param: string $section Name of a custom section which is a subclass of WP_Customize_Section.
since: 4.3.0

render_section_templates()   X-Ref
Renders JS templates for all registered section types.

since: 4.3.0

add_control( $id, $args = array()   X-Ref
Adds a customize control.

return: WP_Customize_Control The instance of the control that was added.
param: WP_Customize_Control|string $id   Customize Control object, or ID.
param: array                       $args Optional. Array of properties for the new Control object.
since: 3.4.0
since: 4.5.0 Return added WP_Customize_Control instance.

get_control( $id )   X-Ref
Retrieves a customize control.

return: WP_Customize_Control|void The control object, if set.
param: string $id ID of the control.
since: 3.4.0

remove_control( $id )   X-Ref
Removes a customize control.

Note that removing the control doesn't destroy the WP_Customize_Control instance or remove its filters.

param: string $id ID of the control.
since: 3.4.0

register_control_type( $control )   X-Ref
Registers a customize control type.

Registered types are eligible to be rendered via JS and created dynamically.

param: string $control Name of a custom control which is a subclass of
since: 4.1.0

render_control_templates()   X-Ref
Renders JS templates for all registered control types.

since: 4.1.0

_cmp_priority( $a, $b )   X-Ref
Helper function to compare two objects by priority, ensuring sort stability via instance_number.

return: int
param: WP_Customize_Panel|WP_Customize_Section|WP_Customize_Control $a Object A.
param: WP_Customize_Panel|WP_Customize_Section|WP_Customize_Control $b Object B.
since: 3.4.0

prepare_controls()   X-Ref
Prepares panels, sections, and controls.

For each, check if required related components exist,
whether the user has the necessary capabilities,
and sort by priority.

since: 3.4.0

enqueue_control_scripts()   X-Ref
Enqueues scripts for customize controls.

since: 3.4.0

is_ios()   X-Ref
Determines whether the user agent is iOS.

return: bool Whether the user agent is iOS.
since: 4.4.0

get_document_title_template()   X-Ref
Gets the template string for the Customizer pane document title.

return: string The template string for the document title.
since: 4.4.0

set_preview_url( $preview_url )   X-Ref
Sets the initial URL to be previewed.

URL is validated.

param: string $preview_url URL to be previewed.
since: 4.4.0

get_preview_url()   X-Ref
Gets the initial URL to be previewed.

return: string URL being previewed.
since: 4.4.0

is_cross_domain()   X-Ref
Determines whether the admin and the frontend are on different domains.

return: bool Whether cross-domain.
since: 4.7.0

get_allowed_urls()   X-Ref
Gets URLs allowed to be previewed.

If the front end and the admin are served from the same domain, load the
preview over ssl if the Customizer is being loaded over ssl. This avoids
insecure content warnings. This is not attempted if the admin and front end
are on different domains to avoid the case where the front end doesn't have
ssl certs. Domain mapping plugins can allow other urls in these conditions
using the customize_allowed_urls filter.

return: array Allowed URLs.
since: 4.7.0

get_messenger_channel()   X-Ref
Gets messenger channel.

return: string Messenger channel.
since: 4.7.0

set_return_url( $return_url )   X-Ref
Sets URL to link the user to when closing the Customizer.

URL is validated.

param: string $return_url URL for return link.
since: 4.4.0

get_return_url()   X-Ref
Gets URL to link the user to when closing the Customizer.

return: string URL for link to close Customizer.
since: 4.4.0

set_autofocus( $autofocus )   X-Ref
Sets the autofocused constructs.

param: array $autofocus {
since: 4.4.0

get_autofocus()   X-Ref
Gets the autofocused constructs.

return: string[] {
since: 4.4.0

get_nonces()   X-Ref
Gets nonces for the Customizer.

return: array Nonces.
since: 4.5.0

customize_pane_settings()   X-Ref
Prints JavaScript settings for parent window.

since: 4.4.0

get_previewable_devices()   X-Ref
Returns a list of devices to allow previewing.

return: array List of devices with labels and default setting.
since: 4.5.0

register_controls()   X-Ref
Registers some default controls.

since: 3.4.0

has_published_pages()   X-Ref
Returns whether there are published pages.

Used as active callback for static front page section and controls.

return: bool Whether there are published (or to be published) pages.
since: 4.7.0

register_dynamic_settings()   X-Ref
Adds settings from the POST data that were not added with code, e.g. dynamically-created settings for Widgets

since: 4.2.0

handle_load_themes_request()   X-Ref
Loads themes into the theme browsing/installation UI.

since: 4.9.0

_sanitize_header_textcolor( $color )   X-Ref
Callback for validating the header_textcolor value.

Accepts 'blank', and otherwise uses sanitize_hex_color_no_hash().
Returns default text color if hex color is empty.

return: mixed
param: string $color
since: 3.4.0

_sanitize_background_setting( $value, $setting )   X-Ref
Callback for validating a background setting value.

return: string|WP_Error Background value or validation error.
param: string               $value   Repeat value.
param: WP_Customize_Setting $setting Setting.
since: 4.7.0

export_header_video_settings( $response, $selective_refresh, $partials )   X-Ref
Exports header video settings to facilitate selective refresh.

return: array
param: array                          $response          Response.
param: WP_Customize_Selective_Refresh $selective_refresh Selective refresh component.
param: array                          $partials          Array of partials.
since: 4.7.0

_validate_header_video( $validity, $value )   X-Ref
Callback for validating the header_video value.

Ensures that the selected video is less than 8MB and provides an error message.

return: mixed
param: WP_Error $validity
param: mixed    $value
since: 4.7.0

_validate_external_header_video( $validity, $value )   X-Ref
Callback for validating the external_header_video value.

Ensures that the provided URL is supported.

return: mixed
param: WP_Error $validity
param: mixed    $value
since: 4.7.0

_sanitize_external_header_video( $value )   X-Ref
Callback for sanitizing the external_header_video value.

return: string Sanitized URL.
param: string $value URL.
since: 4.7.1

_render_custom_logo_partial()   X-Ref
Callback for rendering the custom logo, used in the custom_logo partial.

This method exists because the partial object and context data are passed
into a partial's render_callback so we cannot use get_custom_logo() as
the render_callback directly since it expects a blog ID as the first
argument. When WP no longer supports PHP 5.3, this method can be removed
in favor of an anonymous function.

return: string Custom logo.
since: 4.5.0



Generated: Sat Nov 23 01:00:02 2024 Cross-referenced by PHPXref 0.7.1