WP_Customize_Manager
class WP_Customize_Manager
// Constructor: function Object() { [native code] } Customize Manager class.
Methods 117 methods
| Method / Return | Description |
|---|---|
| __construct() void | Constructor.
Parameters: $args: mixed |
| doing_ajax() bool | Returns true if it's an Ajax request.
Parameters: $action: mixed |
| wp_die() void | Custom wp_die wrapper. Returns either the standard message for UI
Parameters: $ajax_message: mixed, $message: mixed |
| wp_die_handler() callable | Returns the Ajax wp_die() handler if it's a customized request. |
| setup_theme() void | Starts preview and customize theme. |
| establish_loaded_changeset() void | Establishes the loaded changeset. |
| after_setup_theme() void | Callback to validate a theme once it is loaded |
| start_previewing_theme() void | If the theme to be previewed isn't the active theme, add filter callbacks |
| stop_previewing_theme() void | Stops previewing the selected theme. |
| settings_previewed() bool | Gets whether settings are or will be previewed. |
| autosaved() bool | Gets whether data from a changeset's autosaved revision should be loaded if it exists. |
| branching() bool | Whether the changeset branching is allowed. |
| changeset_uuid() string | Gets the changeset UUID. |
| theme() WP_Theme | Gets the theme being customized. |
| settings() array | Gets the registered settings. |
| controls() array | Gets the registered controls. |
| containers() array | Gets the registered containers. |
| sections() array | Gets the registered sections. |
| panels() array | Gets the registered panels. |
| is_theme_active() bool | Checks if the current theme is active. |
| wp_loaded() void | Registers styles/scripts and initialize the preview of each setting |
| wp_redirect_status() int | Prevents Ajax requests from following redirects when previewing a theme
Parameters: $status: mixed |
| find_changeset_post_id() (int | Finds the changeset post ID for a given changeset UUID.
Parameters: $uuid: mixed |
| get_changeset_posts() WP_Post[] | Gets changeset posts.
Parameters: $args: mixed |
| dismiss_user_auto_draft_changesets() int | Dismisses all of the current user's auto-drafts (other than the present one). |
| changeset_post_id() (int | Gets the changeset post ID for the loaded changeset. |
| get_changeset_post_data() (array | Gets the data stored in a changeset post.
Parameters: $post_id: mixed |
| changeset_data() array | Gets changeset data. |
| import_theme_starter_content() void | Imports theme starter content into the customized state.
Parameters: $starter_content: mixed |
| prepare_starter_content_attachments() array | Prepares starter content attachments.
Parameters: $attachments: mixed |
| _save_starter_content_changeset() void | Saves starter content changeset. |
| unsanitized_post_values() array | Gets dirty pre-sanitized setting values in the current customized state.
Parameters: $args: mixed |
| post_value() (string | Returns the sanitized value for a given setting from the current customized state.
Parameters: $setting: mixed, $default_value: mixed |
| set_post_value() void | Overrides a setting's value in the current customized state.
Parameters: $setting_id: mixed, $value: mixed |
| customize_preview_init() void | Prints JavaScript settings. |
| filter_iframe_security_headers() array | Filters the X-Frame-Options and Content-Security-Policy headers to ensure frontend can load in customizer.
Parameters: $headers: mixed |
| add_state_query_params() string | Adds customize state query params to a given URL if preview is allowed.
Parameters: $url: mixed |
| customize_preview_override_404_status() void | Prevents sending a 404 status when returning the response for the customize |
| customize_preview_base() void | Prints base element for preview frame. |
| customize_preview_html5() void | Prints a workaround to handle HTML5 tags in IE < 9. |
| customize_preview_loading_style() void | Prints CSS for loading indicators for the Customizer preview. |
| remove_frameless_preview_messenger_channel() void | Removes customize_messenger_channel query parameter from the preview window when it is not in an iframe. |
| customize_preview_settings() void | Prints JavaScript settings for preview frame. |
| customize_preview_signature() void | Prints a signature so we can ensure the Customizer was properly executed. |
| remove_preview_signature() (callable | Removes the signature in case we experience a case where the Customizer was not properly executed.
Parameters: $callback: mixed |
| is_preview() bool | Determines whether it is a theme preview or not. |
| get_template() string | Retrieves the template name of the previewed theme. |
| get_stylesheet() string | Retrieves the stylesheet name of the previewed theme. |
| get_template_root() string | Retrieves the template root of the previewed theme. |
| get_stylesheet_root() string | Retrieves the stylesheet root of the previewed theme. |
| current_theme() string | Filters the active theme and return the name of the previewed theme.
Parameters: $current_theme: mixed |
| validate_setting_values() array | Validates setting values.
Parameters: $setting_values: mixed, $options: mixed |
| prepare_setting_validity_for_js() (true | Prepares setting validity for exporting to the client (JS).
Parameters: $validity: mixed |
| save() void | Handles customize_save WP Ajax request to save/update a changeset. |
| save_changeset_post() (array | Saves the post for the loaded changeset.
Parameters: $args: mixed |
| preserve_insert_changeset_post_content() array | Preserves the initial JSON post_content passed to save into the post.
Parameters: $data: mixed, $postarr: mixed, $unsanitized_postarr: mixed |
| trash_changeset_post() mixed | Trashes or deletes a changeset post.
Parameters: $post: mixed |
| handle_changeset_trash_request() void | Handles request to trash a changeset. |
| grant_edit_post_capability_for_changeset() array | Re-maps 'edit_post' meta cap for a customize_changeset post to be the same as 'customize' maps.
Parameters: $caps: mixed, $cap: mixed, $user_id: mixed, $args: mixed |
| set_changeset_lock() void | Marks the changeset post as being currently edited by the current user.
Parameters: $changeset_post_id: mixed, $take_over: mixed |
| refresh_changeset_lock() void | Refreshes changeset lock with the current time if current user edited the changeset before.
Parameters: $changeset_post_id: mixed |
| add_customize_screen_to_heartbeat_settings() array | Filters heartbeat settings for the Customizer.
Parameters: $settings: mixed |
| get_lock_user_data() (array | Gets lock user data.
Parameters: $user_id: mixed |
| check_changeset_lock_with_heartbeat() array | Checks locked changeset with heartbeat API.
Parameters: $response: mixed, $data: mixed, $screen_id: mixed |
| handle_override_changeset_lock_request() void | Removes changeset lock when take over request is sent via Ajax. |
| _filter_revision_post_has_changed() bool | Filters whether a changeset has changed to create a new revision.
Parameters: $post_has_changed: mixed, $latest_revision: mixed, $post: mixed |
| _publish_changeset_values() (true | Publishes the values of a changeset.
Parameters: $changeset_post_id: mixed |
| update_stashed_theme_mod_settings() (array | Updates stashed theme mod settings.
Parameters: $inactive_theme_mod_settings: mixed |
| refresh_nonces() void | Refreshes nonces for the current preview. |
| handle_dismiss_autosave_or_lock_request() void | Deletes a given auto-draft changeset or the autosave revision for a given changeset or delete changeset lock. |
| add_setting() WP_Customize_Setting | Adds a customize setting.
Parameters: $id: mixed, $args: mixed |
| add_dynamic_settings() array | Registers any dynamically-created settings, such as those from $_POST['customized']
Parameters: $setting_ids: mixed |
| get_setting() (WP_Customize_Setting | Retrieves a customize setting.
Parameters: $id: mixed |
| remove_setting() void | Removes a customize setting.
Parameters: $id: mixed |
| add_panel() WP_Customize_Panel | Adds a customize panel.
Parameters: $id: mixed, $args: mixed |
| get_panel() (WP_Customize_Panel | Retrieves a customize panel.
Parameters: $id: mixed |
| remove_panel() void | Removes a customize panel.
Parameters: $id: mixed |
| register_panel_type() void | Registers a customize panel type.
Parameters: $panel: mixed |
| render_panel_templates() void | Renders JS templates for all registered panel types. |
| add_section() WP_Customize_Section | Adds a customize section.
Parameters: $id: mixed, $args: mixed |
| get_section() (WP_Customize_Section | Retrieves a customize section.
Parameters: $id: mixed |
| remove_section() void | Removes a customize section.
Parameters: $id: mixed |
| register_section_type() void | Registers a customize section type.
Parameters: $section: mixed |
| render_section_templates() void | Renders JS templates for all registered section types. |
| add_control() WP_Customize_Control | Adds a customize control.
Parameters: $id: mixed, $args: mixed |
| get_control() (WP_Customize_Control | Retrieves a customize control.
Parameters: $id: mixed |
| remove_control() void | Removes a customize control.
Parameters: $id: mixed |
| register_control_type() void | Registers a customize control type.
Parameters: $control: mixed |
| render_control_templates() void | Renders JS templates for all registered control types. |
| _cmp_priority() int | Helper function to compare two objects by priority, ensuring sort stability via instance_number.
Parameters: $a: mixed, $b: mixed |
| prepare_controls() void | Prepares panels, sections, and controls. |
| enqueue_control_scripts() void | Enqueues scripts for customize controls. |
| is_ios() bool | Determines whether the user agent is iOS. |
| get_document_title_template() string | Gets the template string for the Customizer pane document title. |
| set_preview_url() void | Sets the initial URL to be previewed.
Parameters: $preview_url: mixed |
| get_preview_url() string | Gets the initial URL to be previewed. |
| is_cross_domain() bool | Determines whether the admin and the frontend are on different domains. |
| get_allowed_urls() array | Gets URLs allowed to be previewed. |
| get_messenger_channel() string | Gets messenger channel. |
| set_return_url() void | Sets URL to link the user to when closing the Customizer.
Parameters: $return_url: mixed |
| get_return_url() string | Gets URL to link the user to when closing the Customizer. |
| set_autofocus() void | Sets the autofocused constructs.
Parameters: $autofocus: mixed |
| get_autofocus() string[] | Gets the autofocused constructs. |
| get_nonces() array | Gets nonces for the Customizer. |
| customize_pane_settings() void | Prints JavaScript settings for parent window. |
| get_previewable_devices() array | Returns a list of devices to allow previewing. |
| register_controls() void | Registers some default controls. |
| has_published_pages() bool | Returns whether there are published pages. |
| register_dynamic_settings() void | Adds settings from the POST data that were not added with code, e.g. dynamically-created settings for Widgets |
| handle_load_themes_request() void | Loads themes into the theme browsing/installation UI. |
| _sanitize_header_textcolor() mixed | Callback for validating the header_textcolor value.
Parameters: $color: mixed |
| _sanitize_background_setting() (string | Callback for validating a background setting value.
Parameters: $value: mixed, $setting: mixed |
| export_header_video_settings() array | Exports header video settings to facilitate selective refresh.
Parameters: $response: mixed, $selective_refresh: mixed, $partials: mixed |
| _validate_header_video() mixed | Callback for validating the header_video value.
Parameters: $validity: mixed, $value: mixed |
| _validate_external_header_video() mixed | Callback for validating the external_header_video value.
Parameters: $validity: mixed, $value: mixed |
| _sanitize_external_header_video() string | Callback for sanitizing the external_header_video value.
Parameters: $value: mixed |
| _render_custom_logo_partial() string | Callback for rendering the custom logo, used in the custom_logo partial. |
Properties
| Property / Type | Description |
|---|---|
| $theme mixed public | No description available. |
| $original_stylesheet mixed public | No description available. |
| $previewing mixed public | No description available. |
| $widgets mixed public | No description available. |
| $nav_menus mixed public | No description available. |
| $selective_refresh mixed public | No description available. |
| $settings mixed public | No description available. |
| $containers mixed public | No description available. |
| $panels mixed public | No description available. |
| $components mixed public | No description available. |
| $sections mixed public | No description available. |
| $controls mixed public | No description available. |
| $registered_panel_types mixed public | No description available. |
| $registered_section_types mixed public | No description available. |
| $registered_control_types mixed public | No description available. |
| $preview_url mixed public | No description available. |
| $return_url mixed public | No description available. |
| $autofocus mixed public | No description available. |
| $messenger_channel mixed public | No description available. |
| $autosaved mixed public | No description available. |
| $branching mixed public | No description available. |
| $settings_previewed mixed public | No description available. |
| $saved_starter_content_changeset mixed public | No description available. |
| $_post_values mixed public | No description available. |
| $_changeset_uuid mixed public | No description available. |
| $_changeset_post_id mixed public | No description available. |
| $_changeset_data mixed public | No description available. |
| $pending_starter_content_settings_ids mixed public | No description available. |
| $store_changeset_revision mixed public | No description available. |