WP_Customize_Manager::customize_pane_settings()
- Since
- 4.4.0
- Source
wp-includes/class-wp-customize-manager.php:4822
Compatibility
- WordPress
- since 4.4.0
- PHP
- 7.4–8.6-dev
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.
Performance profile
How much work a call to WP_Customize_Manager::customize_pane_settings() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.
- Cost class
- Heavy
- Scaling
- Scales with input
- Instructions
- 263–281
- Plugin surface
- None
- Called by
- 0
Reaches the database via get_post().
The body loops, so the work grows with how much data it finds.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 425.
Nothing here hands control to plugin code.
Nothing in core calls this; the cost is only what you spend yourself.
What it touches
- querycontent query
get_post()called directly - optionoption read or write
get_option()called directly - hookthird-party callbacks
apply_filters()one call below WP_Customize_Manager::customize_pane_settings() - cacheobject cache
wp_cache_get()one call below WP_Customize_Manager::customize_pane_settings() - serializeserialisation
maybe_unserialize()one call below WP_Customize_Manager::customize_pane_settings()
Further down the call graph this can also reach transient. That is the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 4 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost WP_Customize_Manager::customize_pane_settings() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
array_keys() && !->changeset_post_id() | 263–273 | wp_login_url(), add_query_arg(), ->unsanitized_post_values(), array_keys(), ->changeset_post_id(), get_post_type_object(), current_user_can(), __(), current_time(), ->changeset_post_id(), ->changeset_uuid(), ->branching(), ->autosaved(), get_option(), get_option(), microtime(), floor(), ->get_stylesheet(), ->is_theme_active(), current_user_can(), ->get_preview_url(), sanitize_url(), ->get_return_url(), sanitize_url(), admin_url(), sanitize_url(), home_url(), sanitize_url(), admin_url(), sanitize_url(), ->get_allowed_urls(), array_map(), ->is_cross_domain(), home_url(), sanitize_url(), sanitize_url(), wp_is_mobile(), ->is_ios(), ->get_nonces(), ->get_autofocus(), ->get_document_title_template(), ->get_previewable_devices(), __(), __(), __(), __(), get_filesystem_method(), ob_start(), self_admin_url(), request_filesystem_credentials(), ob_end_clean(), ->sections(), ->panels(), ob_start(), wp_json_encode(), ->settings(), ->controls(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag() |
array_keys() && !->changeset_post_id() | 267–277 | wp_login_url(), add_query_arg(), ->unsanitized_post_values(), array_keys(), ->changeset_post_id(), get_post_type_object(), current_user_can(), __(), current_time(), ->changeset_post_id(), ->changeset_uuid(), ->branching(), ->autosaved(), ->get_lock_user_data(), get_option(), get_option(), microtime(), floor(), ->get_stylesheet(), ->is_theme_active(), current_user_can(), ->get_preview_url(), sanitize_url(), ->get_return_url(), sanitize_url(), admin_url(), sanitize_url(), home_url(), sanitize_url(), admin_url(), sanitize_url(), ->get_allowed_urls(), array_map(), ->is_cross_domain(), home_url(), sanitize_url(), sanitize_url(), wp_is_mobile(), ->is_ios(), ->get_nonces(), ->get_autofocus(), ->get_document_title_template(), ->get_previewable_devices(), __(), __(), __(), __(), get_filesystem_method(), ob_start(), self_admin_url(), request_filesystem_credentials(), ob_end_clean(), ->sections(), ->panels(), ob_start(), wp_json_encode(), ->settings(), ->controls(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag() |
array_keys() && ->changeset_post_id() | 269–277 | wp_login_url(), add_query_arg(), ->unsanitized_post_values(), array_keys(), ->changeset_post_id(), get_post_type_object(), current_user_can(), __(), current_time(), ->changeset_post_id(), ->changeset_post_id(), wp_check_post_lock(), ->changeset_uuid(), ->branching(), ->autosaved(), get_option(), get_option(), microtime(), floor(), ->get_stylesheet(), ->is_theme_active(), current_user_can(), ->get_preview_url(), sanitize_url(), ->get_return_url(), sanitize_url(), admin_url(), sanitize_url(), home_url(), sanitize_url(), admin_url(), sanitize_url(), ->get_allowed_urls(), array_map(), ->is_cross_domain(), home_url(), sanitize_url(), sanitize_url(), wp_is_mobile(), ->is_ios(), ->get_nonces(), ->get_autofocus(), ->get_document_title_template(), ->get_previewable_devices(), __(), __(), __(), __(), get_filesystem_method(), ob_start(), self_admin_url(), request_filesystem_credentials(), ob_end_clean(), ->sections(), ->panels(), ob_start(), wp_json_encode(), ->settings(), ->controls(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag() |
array_keys() && ->changeset_post_id() | 273–281 | wp_login_url(), add_query_arg(), ->unsanitized_post_values(), array_keys(), ->changeset_post_id(), get_post_type_object(), current_user_can(), __(), current_time(), ->changeset_post_id(), ->changeset_post_id(), wp_check_post_lock(), ->changeset_uuid(), ->branching(), ->autosaved(), ->get_lock_user_data(), get_option(), get_option(), microtime(), floor(), ->get_stylesheet(), ->is_theme_active(), current_user_can(), ->get_preview_url(), sanitize_url(), ->get_return_url(), sanitize_url(), admin_url(), sanitize_url(), home_url(), sanitize_url(), admin_url(), sanitize_url(), ->get_allowed_urls(), array_map(), ->is_cross_domain(), home_url(), sanitize_url(), sanitize_url(), wp_is_mobile(), ->is_ios(), ->get_nonces(), ->get_autofocus(), ->get_document_title_template(), ->get_previewable_devices(), __(), __(), __(), __(), get_filesystem_method(), ob_start(), self_admin_url(), request_filesystem_credentials(), ob_end_clean(), ->sections(), ->panels(), ob_start(), wp_json_encode(), ->settings(), ->controls(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag() |
This body has more branch combinations than are worth enumerating, so the table covers the outcomes found first rather than every one that exists.
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 426 | 263–280 | 34 | 1 more instruction than PHP 8.5 |
| 8.5 | 425 | 263–281 | 34 | |
| 8.4 | 425 | 263–281 | 34 | |
| 8.3 | 425 | 263–281 | 34 | |
| 8.2 | 425 | 263–281 | 34 | |
| 8.1 | 425 | 263–281 | 34 | 3 fewer instructions than PHP 7.4 |
| 7.4 | 428 | 264–282 | 34 |
An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.
Uses · 47
- add_query_arg()Retrieves a modified URL query string.
- wp_login_url()Retrieves the login URL.
- is_user_logged_in()Determines whether the current visitor is a logged in user.
- wp_get_post_autosave()Retrieves the autosaved data of the specified post.
- get_current_user_id()Gets the current user's ID.
- current_user_can()Returns whether the current user has the specified capability.
- get_post_type_object()Retrieves a post type object by name.
- __()Retrieves the translation of $text.
- _x()Retrieves translated string with gettext context.
- get_post()Retrieves post data given a post ID or post object.
- current_time()Retrieves the current time based on specified type.
- get_the_time()Retrieves the time of the post.
Show all 47
- wp_check_post_lock()Determines whether the post is currently being edited by another user.
- get_option()Retrieves an option value based on an option name.
- sanitize_url()Sanitizes a URL for database or redirect usage.
- admin_url()Retrieves the URL to the admin area for the current site.
- home_url()Retrieves the URL for the current site where the front end is accessible.
- wp_is_mobile()Test if the current browser runs on a mobile device (smart phone, tablet, etc.).
- get_filesystem_method()Determines which method to use for reading, writing, modifying, or deleting files on the filesystem.
- request_filesystem_credentials()Displays a form to the user to request for their FTP/SSH details in order to connect to the filesystem.
- self_admin_url()Retrieves the URL to the admin area for either the current site or the network depending on context.
- wp_json_encode()Encodes a variable into JSON, with some confidence checks.
- wp_print_inline_script_tag()Prints an inline script tag.
- wp_remove_surrounding_empty_script_tags()Removes leading and trailing _empty_ script tags.
- WP_Customize_Manager::unsanitized_post_values()Gets dirty pre-sanitized setting values in the current customized state.
- WP_Customize_Manager::get_setting()Retrieves a customize setting.
- WP_Customize_Manager::changeset_post_id()Gets the changeset post ID for the loaded changeset.
- WP_Customize_Manager::autosaved()Gets whether data from a changeset's autosaved revision should be loaded if it exists.
- WP_Customize_Manager::get_changeset_posts()Gets changeset posts.
- WP_Customize_Manager::changeset_uuid()Gets the changeset UUID.
- WP_Customize_Manager::branching()Whether the changeset branching is allowed.
- WP_Customize_Manager::get_lock_user_data()Gets lock user data.
- WP_Customize_Manager::get_stylesheet()Retrieves the stylesheet name of the previewed theme.
- WP_Customize_Manager::is_theme_active()Checks if the current theme is active.
- WP_Customize_Manager::get_preview_url()Gets the initial URL to be previewed.
- WP_Customize_Manager::get_return_url()Gets URL to link the user to when closing the Customizer.
- WP_Customize_Manager::get_allowed_urls()Gets URLs allowed to be previewed.
- WP_Customize_Manager::is_cross_domain()Determines whether the admin and the frontend are on different domains.
- WP_Customize_Manager::is_ios()Determines whether the user agent is iOS.
- WP_Customize_Manager::get_nonces()Gets nonces for the Customizer.
- WP_Customize_Manager::get_autofocus()Gets the autofocused constructs.
- WP_Customize_Manager::get_document_title_template()Gets the template string for the Customizer pane document title.
- WP_Customize_Manager::get_previewable_devices()Returns a list of devices to allow previewing.
- WP_Customize_Manager::sections()Gets the registered sections.
- WP_Customize_Manager::panels()Gets the registered panels.
- WP_Customize_Manager::settings()Gets the registered settings.
- WP_Customize_Manager::controls()Gets the registered controls.
Source code
public function customize_pane_settings() { $login_url = add_query_arg( array( 'interim-login' => 1, 'customize-login' => 1, ), wp_login_url() ); // Ensure dirty flags are set for modified settings. foreach ( array_keys( $this->unsanitized_post_values() ) as $setting_id ) { $setting = $this->get_setting( $setting_id ); if ( $setting ) { $setting->dirty = true; } } $autosave_revision_post = null; $autosave_autodraft_post = null; $changeset_post_id = $this->changeset_post_id(); if ( ! $this->saved_starter_content_changeset && ! $this->autosaved() ) { if ( $changeset_post_id ) { if ( is_user_logged_in() ) { $autosave_revision_post = wp_get_post_autosave( $changeset_post_id, get_current_user_id() ); } } else { $autosave_autodraft_posts = $this->get_changeset_posts( array( 'posts_per_page' => 1, 'post_status' => 'auto-draft', 'exclude_restore_dismissed' => true, ) ); if ( ! empty( $autosave_autodraft_posts ) ) { $autosave_autodraft_post = array_shift( $autosave_autodraft_posts ); } } } $current_user_can_publish = current_user_can( get_post_type_object( 'customize_changeset' )->cap->publish_posts ); // @todo Include all of the status labels here from script-loader.php, and then allow it to be filtered. $status_choices = array(); if ( $current_user_can_publish ) { $status_choices[] = array( 'status' => 'publish', 'label' => __( 'Publish' ), ); } $status_choices[] = array( 'status' => 'draft', 'label' => __( 'Save Draft' ), ); if ( $current_user_can_publish ) { $status_choices[] = array( 'status' => 'future', 'label' => _x( 'Schedule', 'customizer changeset action/button label' ), ); } // Prepare Customizer settings to pass to JavaScript. $changeset_post = null; if ( $changeset_post_id ) { $changeset_post = get_post( $changeset_post_id ); } // Determine initial date to be at present or future, not past. $current_time = current_time( 'mysql', false ); $initial_date = $current_time; if ( $changeset_post ) { $initial_date = get_the_time( 'Y-m-d H:i:s', $changeset_post->ID ); if ( $initial_date < $current_time ) { $initial_date = $current_time; } } $lock_user_id = false; if ( $this->changeset_post_id() ) { $lock_user_id = wp_check_post_lock( $this->changeset_post_id() );Changelog
Introduced in 4.4.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/class-wp-customize-manager.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.