Ticket #54729: 54729.3.diff
File 54729.3.diff, 17.2 KB (added by , 3 years ago) |
---|
-
src/wp-includes/class-wp-customize-manager.php
407 407 } 408 408 409 409 /** 410 * Return true if it's an Ajax request.410 * Returns true if it's an Ajax request. 411 411 * 412 412 * @since 3.4.0 413 413 * @since 4.2.0 Added `$action` param. … … 476 476 } 477 477 478 478 /** 479 * Return the Ajax wp_die() handler if it's a customized request.479 * Returns the Ajax wp_die() handler if it's a customized request. 480 480 * 481 481 * @since 3.4.0 482 482 * @deprecated 4.7.0 … … 494 494 } 495 495 496 496 /** 497 * Start preview and customize theme.497 * Starts preview and customize theme. 498 498 * 499 * Check if customize query variable exist. Init filters to filter the active theme.499 * Checks if customize query variable exist. Init filters to filter the active theme. 500 500 * 501 501 * @since 3.4.0 502 502 * … … 597 597 } 598 598 599 599 /** 600 * Establish the loaded changeset.600 * Establishes the loaded changeset. 601 601 * 602 602 * This method runs right at after_setup_theme and applies the 'customize_changeset_branching' filter to determine 603 603 * whether concurrent changesets are allowed. Then if the Customizer is not initialized with a `changeset_uuid` param, … … 697 697 } 698 698 699 699 /** 700 * Stop previewing the selected theme.700 * Stops previewing the selected theme. 701 701 * 702 702 * Removes filters to change the active theme. 703 703 * … … 802 802 } 803 803 804 804 /** 805 * Get the changeset UUID.805 * Gets the changeset UUID. 806 806 * 807 807 * @since 4.7.0 808 808 * … … 818 818 } 819 819 820 820 /** 821 * Get the theme being customized.821 * Gets the theme being customized. 822 822 * 823 823 * @since 3.4.0 824 824 * … … 832 832 } 833 833 834 834 /** 835 * Get the registered settings.835 * Gets the registered settings. 836 836 * 837 837 * @since 3.4.0 838 838 * … … 843 843 } 844 844 845 845 /** 846 * Get the registered controls.846 * Gets the registered controls. 847 847 * 848 848 * @since 3.4.0 849 849 * … … 854 854 } 855 855 856 856 /** 857 * Get the registered containers.857 * Gets the registered containers. 858 858 * 859 859 * @since 4.0.0 860 860 * … … 865 865 } 866 866 867 867 /** 868 * Get the registered sections.868 * Gets the registered sections. 869 869 * 870 870 * @since 3.4.0 871 871 * … … 876 876 } 877 877 878 878 /** 879 * Get the registered panels.879 * Gets the registered panels. 880 880 * 881 881 * @since 4.0.0 882 882 * … … 898 898 } 899 899 900 900 /** 901 * Register styles/scripts and initialize the preview of each setting901 * Registers styles/scripts and initialize the preview of each setting 902 902 * 903 903 * @since 3.4.0 904 904 */ … … 966 966 } 967 967 968 968 /** 969 * Find the changeset post ID for a given changeset UUID.969 * Finds the changeset post ID for a given changeset UUID. 970 970 * 971 971 * @since 4.7.0 972 972 * … … 1004 1004 } 1005 1005 1006 1006 /** 1007 * Get changeset posts.1007 * Gets changeset posts. 1008 1008 * 1009 1009 * @since 4.9.0 1010 1010 * … … 1077 1077 } 1078 1078 1079 1079 /** 1080 * Get the changeset post ID for the loaded changeset.1080 * Gets the changeset post ID for the loaded changeset. 1081 1081 * 1082 1082 * @since 4.7.0 1083 1083 * … … 1098 1098 } 1099 1099 1100 1100 /** 1101 * Get the data stored in a changeset post.1101 * Gets the data stored in a changeset post. 1102 1102 * 1103 1103 * @since 4.7.0 1104 1104 * … … 1132 1132 } 1133 1133 1134 1134 /** 1135 * Get changeset data.1135 * Gets changeset data. 1136 1136 * 1137 1137 * @since 4.7.0 1138 1138 * @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. … … 1179 1179 protected $pending_starter_content_settings_ids = array(); 1180 1180 1181 1181 /** 1182 * Import theme starter content into the customized state.1182 * Imports theme starter content into the customized state. 1183 1183 * 1184 1184 * @since 4.7.0 1185 1185 * … … 1632 1632 } 1633 1633 1634 1634 /** 1635 * Prepare starter content attachments.1635 * Prepares starter content attachments. 1636 1636 * 1637 * Ensure that the attachments are valid and that they have slugs and file name/path.1637 * Ensures that the attachments are valid and that they have slugs and file name/path. 1638 1638 * 1639 1639 * @since 4.7.0 1640 1640 * … … 1694 1694 } 1695 1695 1696 1696 /** 1697 * Save starter content changeset.1697 * Saves starter content changeset. 1698 1698 * 1699 1699 * @since 4.7.0 1700 1700 */ … … 1716 1716 } 1717 1717 1718 1718 /** 1719 * Get dirty pre-sanitized setting values in the current customized state.1719 * Gets dirty pre-sanitized setting values in the current customized state. 1720 1720 * 1721 1721 * The returned array consists of a merge of three sources: 1722 1722 * 1. If the theme is not currently active, then the base array is any stashed … … 1836 1836 } 1837 1837 1838 1838 /** 1839 * Override a setting's value in the current customized state.1839 * Overrides a setting's value in the current customized state. 1840 1840 * 1841 1841 * The name "post_value" is a carry-over from when the customized state was 1842 1842 * exclusively sourced from `$_POST['customized']`. … … 1882 1882 } 1883 1883 1884 1884 /** 1885 * Print JavaScript settings.1885 * Prints JavaScript settings. 1886 1886 * 1887 1887 * @since 3.4.0 1888 1888 */ … … 1957 1957 } 1958 1958 1959 1959 /** 1960 * Add customize state query params to a given URL if preview is allowed.1960 * Adds customize state query params to a given URL if preview is allowed. 1961 1961 * 1962 1962 * @since 4.7.0 1963 1963 * … … 2001 2001 } 2002 2002 2003 2003 /** 2004 * Prevent sending a 404 status when returning the response for the customize2004 * Prevents sending a 404 status when returning the response for the customize 2005 2005 * preview, since it causes the jQuery Ajax to fail. Send 200 instead. 2006 2006 * 2007 2007 * @since 4.0.0 … … 2012 2012 } 2013 2013 2014 2014 /** 2015 * Print base element for preview frame.2015 * Prints base element for preview frame. 2016 2016 * 2017 2017 * @since 3.4.0 2018 2018 * @deprecated 4.7.0 … … 2022 2022 } 2023 2023 2024 2024 /** 2025 * Print a workaround to handle HTML5 tags in IE < 9.2025 * Prints a workaround to handle HTML5 tags in IE < 9. 2026 2026 * 2027 2027 * @since 3.4.0 2028 2028 * @deprecated 4.7.0 Customizer no longer supports IE8, so all supported browsers recognize HTML5. … … 2032 2032 } 2033 2033 2034 2034 /** 2035 * Print CSS for loading indicators for the Customizer preview.2035 * Prints CSS for loading indicators for the Customizer preview. 2036 2036 * 2037 2037 * @since 4.2.0 2038 2038 */ … … 2061 2061 } 2062 2062 2063 2063 /** 2064 * Remove customize_messenger_channel query parameter from the preview window when it is not in an iframe.2064 * Removes customize_messenger_channel query parameter from the preview window when it is not in an iframe. 2065 2065 * 2066 2066 * This ensures that the admin bar will be shown. It also ensures that link navigation will 2067 2067 * work as expected since the parent frame is not being sent the URL to navigate to. … … 2098 2098 } 2099 2099 2100 2100 /** 2101 * Print JavaScript settings for preview frame.2101 * Prints JavaScript settings for preview frame. 2102 2102 * 2103 2103 * @since 3.4.0 2104 2104 */ … … 2253 2253 } 2254 2254 2255 2255 /** 2256 * Retrieve the template name of the previewed theme.2256 * Retrieves the template name of the previewed theme. 2257 2257 * 2258 2258 * @since 3.4.0 2259 2259 * … … 2264 2264 } 2265 2265 2266 2266 /** 2267 * Retrieve the stylesheet name of the previewed theme.2267 * Retrieves the stylesheet name of the previewed theme. 2268 2268 * 2269 2269 * @since 3.4.0 2270 2270 * … … 2275 2275 } 2276 2276 2277 2277 /** 2278 * Retrieve the template root of the previewed theme.2278 * Retrieves the template root of the previewed theme. 2279 2279 * 2280 2280 * @since 3.4.0 2281 2281 * … … 2286 2286 } 2287 2287 2288 2288 /** 2289 * Retrieve the stylesheet root of the previewed theme.2289 * Retrieves the stylesheet root of the previewed theme. 2290 2290 * 2291 2291 * @since 3.4.0 2292 2292 * … … 2408 2408 } 2409 2409 2410 2410 /** 2411 * Handle customize_save WP Ajax request to save/update a changeset.2411 * Handles customize_save WP Ajax request to save/update a changeset. 2412 2412 * 2413 2413 * @since 3.4.0 2414 2414 * @since 4.7.0 The semantics of this method have changed to update a changeset, optionally to also change the status and other attributes. … … 2604 2604 } 2605 2605 2606 2606 /** 2607 * Save the post for the loaded changeset.2607 * Saves the post for the loaded changeset. 2608 2608 * 2609 2609 * @since 4.7.0 2610 2610 * … … 2722 2722 $this->add_dynamic_settings( array_keys( $post_values ) ); // Ensure settings get created even if they lack an input value. 2723 2723 2724 2724 /* 2725 * Get list of IDs for settings that have values different from what is currently2725 * Gets list of IDs for settings that have values different from what is currently 2726 2726 * saved in the changeset. By skipping any values that are already the same, the 2727 2727 * subset of changed settings can be passed into validate_setting_values to prevent 2728 2728 * an underprivileged modifying a single setting for which they have the capability … … 2992 2992 } 2993 2993 2994 2994 /** 2995 * Preserve the initial JSON post_content passed to save into the post.2995 * Preserves the initial JSON post_content passed to save into the post. 2996 2996 * 2997 2997 * This is needed to prevent KSES and other {@see 'content_save_pre'} filters 2998 2998 * from corrupting JSON data. … … 3037 3037 } 3038 3038 3039 3039 /** 3040 * Trash or deletea changeset post.3040 * Trashes or deletes a changeset post. 3041 3041 * 3042 3042 * The following re-formulates the logic from `wp_trash_post()` as done in 3043 3043 * `wp_publish_post()`. The reason for bypassing `wp_trash_post()` is that it … … 3116 3116 } 3117 3117 3118 3118 /** 3119 * Handle request to trash a changeset.3119 * Handles request to trash a changeset. 3120 3120 * 3121 3121 * @since 4.9.0 3122 3122 */ … … 3201 3201 } 3202 3202 3203 3203 /** 3204 * Re-map 'edit_post' meta cap for a customize_changeset post to be the same as 'customize' maps.3204 * Re-maps 'edit_post' meta cap for a customize_changeset post to be the same as 'customize' maps. 3205 3205 * 3206 3206 * There is essentially a "meta meta" cap in play here, where 'edit_post' meta cap maps to 3207 3207 * the 'customize' meta cap which then maps to 'edit_theme_options'. This is currently … … 3295 3295 } 3296 3296 3297 3297 /** 3298 * Get lock user data.3298 * Gets lock user data. 3299 3299 * 3300 3300 * @since 4.9.0 3301 3301 * … … 3318 3318 } 3319 3319 3320 3320 /** 3321 * Check locked changeset with heartbeat API.3321 * Checks locked changeset with heartbeat API. 3322 3322 * 3323 3323 * @since 4.9.0 3324 3324 * … … 3427 3427 } 3428 3428 3429 3429 /** 3430 * Publish changeset values.3430 * Publishes changeset values. 3431 3431 * 3432 3432 * This will the values contained in a changeset, even changesets that do not 3433 3433 * correspond to current manager instance. This is called by … … 3617 3617 } 3618 3618 3619 3619 /** 3620 * Update stashed theme mod settings.3620 * Updates stashed theme mod settings. 3621 3621 * 3622 3622 * @since 4.7.0 3623 3623 * … … 3654 3654 } 3655 3655 3656 3656 /** 3657 * Refresh nonces for the current preview.3657 * Refreshes nonces for the current preview. 3658 3658 * 3659 3659 * @since 4.2.0 3660 3660 */ … … 3667 3667 } 3668 3668 3669 3669 /** 3670 * Delete a given auto-draft changeset or the autosave revision for a given changeset or delete changeset lock.3670 * Deletes a given auto-draft changeset or the autosave revision for a given changeset or delete changeset lock. 3671 3671 * 3672 3672 * @since 4.9.0 3673 3673 */ … … 3735 3735 } 3736 3736 3737 3737 /** 3738 * Add a customize setting.3738 * Adds a customize setting. 3739 3739 * 3740 3740 * @since 3.4.0 3741 3741 * @since 4.5.0 Return added WP_Customize_Setting instance. … … 3769 3769 } 3770 3770 3771 3771 /** 3772 * Register any dynamically-created settings, such as those from $_POST['customized']3772 * Registers any dynamically-created settings, such as those from $_POST['customized'] 3773 3773 * that have no corresponding setting created. 3774 3774 * 3775 3775 * This is a mechanism to "wake up" settings that have been dynamically created … … 3830 3830 } 3831 3831 3832 3832 /** 3833 * Retrieve a customize setting.3833 * Retrieves a customize setting. 3834 3834 * 3835 3835 * @since 3.4.0 3836 3836 * … … 3844 3844 } 3845 3845 3846 3846 /** 3847 * Remove a customize setting.3847 * Removes a customize setting. 3848 3848 * 3849 3849 * Note that removing the setting doesn't destroy the WP_Customize_Setting instance or remove its filters. 3850 3850 * … … 3857 3857 } 3858 3858 3859 3859 /** 3860 * Add a customize panel.3860 * Adds a customize panel. 3861 3861 * 3862 3862 * @since 4.0.0 3863 3863 * @since 4.5.0 Return added WP_Customize_Panel instance. … … 3882 3882 } 3883 3883 3884 3884 /** 3885 * Retrieve a customize panel.3885 * Retrieves a customize panel. 3886 3886 * 3887 3887 * @since 4.0.0 3888 3888 * … … 3896 3896 } 3897 3897 3898 3898 /** 3899 * Remove a customize panel.3899 * Removes a customize panel. 3900 3900 * 3901 3901 * Note that removing the panel doesn't destroy the WP_Customize_Panel instance or remove its filters. 3902 3902 * … … 3926 3926 } 3927 3927 3928 3928 /** 3929 * Register a customize panel type.3929 * Registers a customize panel type. 3930 3930 * 3931 3931 * Registered types are eligible to be rendered via JS and created dynamically. 3932 3932 * … … 3941 3941 } 3942 3942 3943 3943 /** 3944 * Render JS templates for all registered panel types.3944 * Renders JS templates for all registered panel types. 3945 3945 * 3946 3946 * @since 4.3.0 3947 3947 */ … … 3953 3953 } 3954 3954 3955 3955 /** 3956 * Add a customize section.3956 * Adds a customize section. 3957 3957 * 3958 3958 * @since 3.4.0 3959 3959 * @since 4.5.0 Return added WP_Customize_Section instance. … … 3978 3978 } 3979 3979 3980 3980 /** 3981 * Retrieve a customize section.3981 * Retrieves a customize section. 3982 3982 * 3983 3983 * @since 3.4.0 3984 3984 * … … 3992 3992 } 3993 3993 3994 3994 /** 3995 * Remove a customize section.3995 * Removes a customize section. 3996 3996 * 3997 3997 * Note that removing the section doesn't destroy the WP_Customize_Section instance or remove its filters. 3998 3998 * … … 4005 4005 } 4006 4006 4007 4007 /** 4008 * Register a customize section type.4008 * Registers a customize section type. 4009 4009 * 4010 4010 * Registered types are eligible to be rendered via JS and created dynamically. 4011 4011 * … … 4020 4020 } 4021 4021 4022 4022 /** 4023 * Render JS templates for all registered section types.4023 * Renders JS templates for all registered section types. 4024 4024 * 4025 4025 * @since 4.3.0 4026 4026 */ … … 4032 4032 } 4033 4033 4034 4034 /** 4035 * Add a customize control.4035 * Adds a customize control. 4036 4036 * 4037 4037 * @since 3.4.0 4038 4038 * @since 4.5.0 Return added WP_Customize_Control instance. … … 4057 4057 } 4058 4058 4059 4059 /** 4060 * Retrieve a customize control.4060 * Retrieves a customize control. 4061 4061 * 4062 4062 * @since 3.4.0 4063 4063 * … … 4071 4071 } 4072 4072 4073 4073 /** 4074 * Remove a customize control.4074 * Removes a customize control. 4075 4075 * 4076 4076 * Note that removing the control doesn't destroy the WP_Customize_Control instance or remove its filters. 4077 4077 * … … 4084 4084 } 4085 4085 4086 4086 /** 4087 * Register a customize control type.4087 * Registers a customize control type. 4088 4088 * 4089 4089 * Registered types are eligible to be rendered via JS and created dynamically. 4090 4090 * … … 4098 4098 } 4099 4099 4100 4100 /** 4101 * Render JS templates for all registered control types.4101 * Renders JS templates for all registered control types. 4102 4102 * 4103 4103 * @since 4.1.0 4104 4104 */ … … 4388 4388 } 4389 4389 4390 4390 /** 4391 * Prepare panels, sections, and controls.4391 * Prepares panels, sections, and controls. 4392 4392 * 4393 4393 * For each, check if required related components exist, 4394 4394 * whether the user has the necessary capabilities, … … 4522 4522 } 4523 4523 4524 4524 /** 4525 * Determine whether the user agent is iOS.4525 * Determines whether the user agent is iOS. 4526 4526 * 4527 4527 * @since 4.4.0 4528 4528 * … … 4533 4533 } 4534 4534 4535 4535 /** 4536 * Get the template string for the Customizer pane document title.4536 * Gets the template string for the Customizer pane document title. 4537 4537 * 4538 4538 * @since 4.4.0 4539 4539 * … … 4552 4552 } 4553 4553 4554 4554 /** 4555 * Set the initial URL to be previewed.4555 * Sets the initial URL to be previewed. 4556 4556 * 4557 4557 * URL is validated. 4558 4558 * … … 4566 4566 } 4567 4567 4568 4568 /** 4569 * Get the initial URL to be previewed.4569 * Gets the initial URL to be previewed. 4570 4570 * 4571 4571 * @since 4.4.0 4572 4572 * … … 4596 4596 } 4597 4597 4598 4598 /** 4599 * Get URLs allowed to be previewed.4599 * Gets URLs allowed to be previewed. 4600 4600 * 4601 4601 * If the front end and the admin are served from the same domain, load the 4602 4602 * preview over ssl if the Customizer is being loaded over ssl. This avoids … … 4629 4629 } 4630 4630 4631 4631 /** 4632 * Get messenger channel.4632 * Gets messenger channel. 4633 4633 * 4634 4634 * @since 4.7.0 4635 4635 * … … 4640 4640 } 4641 4641 4642 4642 /** 4643 * Set URL to link the user to when closing the Customizer.4643 * Sets URL to link the user to when closing the Customizer. 4644 4644 * 4645 4645 * URL is validated. 4646 4646 * … … 4656 4656 } 4657 4657 4658 4658 /** 4659 * Get URL to link the user to when closing the Customizer.4659 * Gets URL to link the user to when closing the Customizer. 4660 4660 * 4661 4661 * @since 4.4.0 4662 4662 * … … 4699 4699 } 4700 4700 4701 4701 /** 4702 * Set the autofocused constructs.4702 * Sets the autofocused constructs. 4703 4703 * 4704 4704 * @since 4.4.0 4705 4705 * … … 4716 4716 } 4717 4717 4718 4718 /** 4719 * Get the autofocused constructs.4719 * Gets the autofocused constructs. 4720 4720 * 4721 4721 * @since 4.4.0 4722 4722 * … … 4733 4733 } 4734 4734 4735 4735 /** 4736 * Get nonces for the Customizer.4736 * Gets nonces for the Customizer. 4737 4737 * 4738 4738 * @since 4.5.0 4739 4739 * … … 4764 4764 } 4765 4765 4766 4766 /** 4767 * Print JavaScript settings for parent window.4767 * Prints JavaScript settings for parent window. 4768 4768 * 4769 4769 * @since 4.4.0 4770 4770 */ … … 5014 5014 } 5015 5015 5016 5016 /** 5017 * Register some default controls.5017 * Registers some default controls. 5018 5018 * 5019 5019 * @since 3.4.0 5020 5020 */ … … 5732 5732 } 5733 5733 5734 5734 /** 5735 * Return whether there are published pages.5735 * Returns whether there are published pages. 5736 5736 * 5737 5737 * Used as active callback for static front page section and controls. 5738 5738 * … … 5754 5754 } 5755 5755 5756 5756 /** 5757 * Add settings from the POST data that were not added with code, e.g. dynamically-created settings for Widgets5757 * Adds settings from the POST data that were not added with code, e.g. dynamically-created settings for Widgets 5758 5758 * 5759 5759 * @since 4.2.0 5760 5760 * … … 5766 5766 } 5767 5767 5768 5768 /** 5769 * Load themes into the theme browsing/installation UI.5769 * Loads themes into the theme browsing/installation UI. 5770 5770 * 5771 5771 * @since 4.9.0 5772 5772 */ … … 6001 6001 } 6002 6002 6003 6003 /** 6004 * Export header video settings to facilitate selective refresh.6004 * Exports header video settings to facilitate selective refresh. 6005 6005 * 6006 6006 * @since 4.7.0 6007 6007 *