Ticket #39671: 39671.8.diff
| File 39671.8.diff, 29.0 KB (added by , 9 years ago) |
|---|
-
src/wp-includes/class-wp-customize-control.php
diff --git src/wp-includes/class-wp-customize-control.php src/wp-includes/class-wp-customize-control.php index 07c6dcfce1..3d00803131 100644
class WP_Customize_Control { 37 37 public $instance_number; 38 38 39 39 /** 40 * Customizer manager. 41 * 42 * @since 3.4.0 40 43 * @access public 41 44 * @var WP_Customize_Manager 42 45 */ 43 46 public $manager; 44 47 45 48 /** 49 * Control ID. 50 * 51 * @since 3.4.0 46 52 * @access public 47 53 * @var string 48 54 */ … … class WP_Customize_Control { 51 57 /** 52 58 * All settings tied to the control. 53 59 * 60 * @since 3.4.0 54 61 * @access public 55 62 * @var array 56 63 */ … … class WP_Customize_Control { 59 66 /** 60 67 * The primary setting for the control (if there is one). 61 68 * 69 * @since 3.4.0 62 70 * @access public 63 71 * @var string 64 72 */ … … class WP_Customize_Control { 77 85 public $capability; 78 86 79 87 /** 88 * Order priority to load the control in Customizer. 89 * 90 * @since 3.4.0 80 91 * @access public 81 92 * @var int 82 93 */ 83 94 public $priority = 10; 84 95 85 96 /** 97 * Section the control belongs to. 98 * 99 * @since 3.4.0 86 100 * @access public 87 101 * @var string 88 102 */ 89 103 public $section = ''; 90 104 91 105 /** 106 * Label for the control. 107 * 108 * @since 3.4.0 92 109 * @access public 93 110 * @var string 94 111 */ 95 112 public $label = ''; 96 113 97 114 /** 115 * Description for the control. 116 * 117 * @since 3.4.0 98 118 * @access public 99 119 * @var string 100 120 */ 101 121 public $description = ''; 102 122 103 123 /** 104 * @todo: Remove choices124 * List of choices for 'radio' or 'select' type controls, where values are the keys, and labels are the values. 105 125 * 126 * @since 3.4.0 106 127 * @access public 107 128 * @var array 108 129 */ 109 130 public $choices = array(); 110 131 111 132 /** 133 * List of custom input attributes for control output, where attribute names are the keys and values are the values. 134 * 135 * Not used for 'checkbox', 'radio', 'select', 'textarea', or 'dropdown-pages' control types. 136 * 137 * @since 4.0.0 112 138 * @access public 113 139 * @var array 114 140 */ … … class WP_Customize_Control { 131 157 public $json = array(); 132 158 133 159 /** 160 * Control's Type. 161 * 162 * @since 3.4.0 134 163 * @access public 135 164 * @var string 136 165 */ -
src/wp-includes/class-wp-customize-manager.php
diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php index 097be0cf5e..df26d6e02a 100644
final class WP_Customize_Manager { 642 642 * Get the theme being customized. 643 643 * 644 644 * @since 3.4.0 645 * @access public 645 646 * 646 647 * @return WP_Theme 647 648 */ … … final class WP_Customize_Manager { 656 657 * Get the registered settings. 657 658 * 658 659 * @since 3.4.0 660 * @access public 659 661 * 660 662 * @return array 661 663 */ … … final class WP_Customize_Manager { 667 669 * Get the registered controls. 668 670 * 669 671 * @since 3.4.0 672 * @access public 670 673 * 671 674 * @return array 672 675 */ … … final class WP_Customize_Manager { 678 681 * Get the registered containers. 679 682 * 680 683 * @since 4.0.0 684 * @access public 681 685 * 682 686 * @return array 683 687 */ … … final class WP_Customize_Manager { 689 693 * Get the registered sections. 690 694 * 691 695 * @since 3.4.0 696 * @access public 692 697 * 693 698 * @return array 694 699 */ … … final class WP_Customize_Manager { 712 717 * Checks if the current theme is active. 713 718 * 714 719 * @since 3.4.0 720 * @access public 715 721 * 716 722 * @return bool 717 723 */ … … final class WP_Customize_Manager { 723 729 * Register styles/scripts and initialize the preview of each setting 724 730 * 725 731 * @since 3.4.0 732 * @access public 726 733 */ 727 734 public function wp_loaded() { 728 735 … … final class WP_Customize_Manager { 762 769 * 763 770 * @since 3.4.0 764 771 * @deprecated 4.7.0 772 * @access public 765 773 * 766 774 * @param int $status Status. 767 775 * @return int … … final class WP_Customize_Manager { 1546 1554 * Print JavaScript settings. 1547 1555 * 1548 1556 * @since 3.4.0 1557 * @access public 1549 1558 */ 1550 1559 public function customize_preview_init() { 1551 1560 … … final class WP_Customize_Manager { 1683 1692 * 1684 1693 * @since 3.4.0 1685 1694 * @deprecated 4.7.0 Customizer no longer supports IE8, so all supported browsers recognize HTML5. 1695 * @access public 1686 1696 */ 1687 1697 public function customize_preview_html5() { 1688 1698 _deprecated_function( __FUNCTION__, '4.7.0' ); … … final class WP_Customize_Manager { 1758 1768 * Print JavaScript settings for preview frame. 1759 1769 * 1760 1770 * @since 3.4.0 1771 * @access public 1761 1772 */ 1762 1773 public function customize_preview_settings() { 1763 1774 $post_values = $this->unsanitized_post_values( array( 'exclude_changeset' => true ) ); … … final class WP_Customize_Manager { 1877 1888 * 1878 1889 * @since 3.4.0 1879 1890 * @deprecated 4.7.0 1891 * @access public 1880 1892 */ 1881 1893 public function customize_preview_signature() { 1882 1894 _deprecated_function( __METHOD__, '4.7.0' ); … … final class WP_Customize_Manager { 1887 1899 * 1888 1900 * @since 3.4.0 1889 1901 * @deprecated 4.7.0 1902 * @access public 1890 1903 * 1891 1904 * @param mixed $return Value passed through for {@see 'wp_die_handler'} filter. 1892 1905 * @return mixed Value passed through for {@see 'wp_die_handler'} filter. … … final class WP_Customize_Manager { 1901 1914 * Is it a theme preview? 1902 1915 * 1903 1916 * @since 3.4.0 1917 * @access public 1904 1918 * 1905 1919 * @return bool True if it's a preview, false if not. 1906 1920 */ … … final class WP_Customize_Manager { 1912 1926 * Retrieve the template name of the previewed theme. 1913 1927 * 1914 1928 * @since 3.4.0 1929 * @access public 1915 1930 * 1916 1931 * @return string Template name. 1917 1932 */ … … final class WP_Customize_Manager { 1923 1938 * Retrieve the stylesheet name of the previewed theme. 1924 1939 * 1925 1940 * @since 3.4.0 1941 * @access public 1926 1942 * 1927 1943 * @return string Stylesheet name. 1928 1944 */ … … final class WP_Customize_Manager { 1934 1950 * Retrieve the template root of the previewed theme. 1935 1951 * 1936 1952 * @since 3.4.0 1953 * @access public 1937 1954 * 1938 1955 * @return string Theme root. 1939 1956 */ … … final class WP_Customize_Manager { 1945 1962 * Retrieve the stylesheet root of the previewed theme. 1946 1963 * 1947 1964 * @since 3.4.0 1965 * @access public 1948 1966 * 1949 1967 * @return string Theme root. 1950 1968 */ … … final class WP_Customize_Manager { 1956 1974 * Filters the current theme and return the name of the previewed theme. 1957 1975 * 1958 1976 * @since 3.4.0 1977 * @access public 1959 1978 * 1960 1979 * @param $current_theme {@internal Parameter is not used} 1961 1980 * @return string Theme name. … … final class WP_Customize_Manager { 2067 2086 * 2068 2087 * @since 3.4.0 2069 2088 * @since 4.7.0 The semantics of this method have changed to update a changeset, optionally to also change the status and other attributes. 2089 * @access public 2070 2090 */ 2071 2091 public function save() { 2072 2092 if ( ! is_user_logged_in() ) { … … final class WP_Customize_Manager { 2778 2798 * Refresh nonces for the current preview. 2779 2799 * 2780 2800 * @since 4.2.0 2801 * @access public 2781 2802 */ 2782 2803 public function refresh_nonces() { 2783 2804 if ( ! $this->is_preview() ) { … … final class WP_Customize_Manager { 2795 2816 * @access public 2796 2817 * 2797 2818 * @param WP_Customize_Setting|string $id Customize Setting object, or ID. 2798 * @param array $args Setting arguments; passed to WP_Customize_Setting 2799 * constructor. 2819 * @param array $args { 2820 * Optional. Array of properties for the new WP_Customize_Setting. Default empty array. 2821 * 2822 * @type string $type Type of the setting. Default 'theme_mod'. 2823 * Default 160. 2824 * @type string $capability Capability required for the setting. Default 'edit_theme_options' 2825 * @type string|array $theme_supports Theme features required to support the panel. Default is none. 2826 * @type string $default Default value for the setting. Default is empty string. 2827 * @type string $transport Options for rendering the live preview of changes in Theme Customizer. 2828 * Using 'refresh' makes the change visible by reloading the whole preview. 2829 * Using 'postMessage' allows a custom JavaScript to handle live changes. 2830 * @link https://developer.wordpress.org/themes/customize-api 2831 * Default is 'refresh' 2832 * @type callable $validate_callback Server-side validation callback for the setting's value. 2833 * @type callable $sanitize_callback Callback to filter a Customize setting value in un-slashed form. 2834 * @type callable $sanitize_js_callback Callback to convert a Customize PHP setting value to a value that is 2835 * JSON serializable. 2836 * @type bool $dirty Whether or not the setting is initially dirty when created. 2837 * } 2800 2838 * @return WP_Customize_Setting The instance of the setting that was added. 2801 2839 */ 2802 2840 public function add_setting( $id, $args = array() ) { … … final class WP_Customize_Manager { 2884 2922 * Retrieve a customize setting. 2885 2923 * 2886 2924 * @since 3.4.0 2925 * @access public 2887 2926 * 2888 2927 * @param string $id Customize Setting ID. 2889 2928 * @return WP_Customize_Setting|void The setting, if set. … … final class WP_Customize_Manager { 2898 2937 * Remove a customize setting. 2899 2938 * 2900 2939 * @since 3.4.0 2940 * @access public 2901 2941 * 2902 2942 * @param string $id Customize Setting ID. 2903 2943 */ … … final class WP_Customize_Manager { 2913 2953 * @access public 2914 2954 * 2915 2955 * @param WP_Customize_Panel|string $id Customize Panel object, or Panel ID. 2916 * @param array $args Optional. Panel arguments. Default empty array. 2917 * 2956 * @param array $args { 2957 * Optional. Array of properties for the new Panel object. Default empty array. 2958 * @type int $priority Priority of the panel, defining the display order of panels and sections. 2959 * Default 160. 2960 * @type string $capability Capability required for the panel. Default `edit_theme_options` 2961 * @type string|array $theme_supports Theme features required to support the panel. 2962 * @type string $title Title of the panel to show in UI. 2963 * @type string $description Description to show in the UI. 2964 * @type string $type Type of the panel. 2965 * @type callable $active_callback Active callback. 2966 * } 2918 2967 * @return WP_Customize_Panel The instance of the panel that was added. 2919 2968 */ 2920 2969 public function add_panel( $id, $args = array() ) { … … final class WP_Customize_Manager { 3002 3051 * @access public 3003 3052 * 3004 3053 * @param WP_Customize_Section|string $id Customize Section object, or Section ID. 3005 * @param array $args Section arguments. 3006 * 3054 * @param array $args { 3055 * Optional. Array of properties for the new Panel object. Default empty array. 3056 * @type int $priority Priority of the panel, defining the display order of panels and sections. 3057 * Default 160. 3058 * @type string $panel Priority of the panel, defining the display order of panels and sections. 3059 * @type string $capability Capability required for the panel. Default 'edit_theme_options' 3060 * @type string|array $theme_supports Theme features required to support the panel. 3061 * @type string $title Title of the panel to show in UI. 3062 * @type string $description Description to show in the UI. 3063 * @type string $type Type of the panel. 3064 * @type callable $active_callback Active callback. 3065 * @type bool $description_hidden Hide the description behind a help icon, instead of . Default false. 3066 * } 3007 3067 * @return WP_Customize_Section The instance of the section that was added. 3008 3068 */ 3009 3069 public function add_section( $id, $args = array() ) { … … final class WP_Customize_Manager { 3021 3081 * Retrieve a customize section. 3022 3082 * 3023 3083 * @since 3.4.0 3084 * @access public 3024 3085 * 3025 3086 * @param string $id Section ID. 3026 3087 * @return WP_Customize_Section|void The section, if set. … … final class WP_Customize_Manager { 3034 3095 * Remove a customize section. 3035 3096 * 3036 3097 * @since 3.4.0 3098 * @access public 3037 3099 * 3038 3100 * @param string $id Section ID. 3039 3101 */ … … final class WP_Customize_Manager { 3078 3140 * @access public 3079 3141 * 3080 3142 * @param WP_Customize_Control|string $id Customize Control object, or ID. 3081 * @param array $args Control arguments; passed to WP_Customize_Control 3082 * constructor. 3143 * @param array $args { 3144 * Optional. Array of properties for the new Control object. Default empty array. 3145 * 3146 * @type array $settings All settings tied to the control. If undefined, defaults to `$setting`. 3147 * IDs in the array correspond to the ID of a registered `WP_Customize_Setting`. 3148 * @type string $setting The primary setting for the control (if there is one). Default is 'default'. 3149 * @type string $capability Capability required to use this control. Normally derived from `$settings`. 3150 * @type int $priority Order priority to load the control. Default 10. 3151 * @type string $section The section this control belongs to. Default empty. 3152 * @type string $label Label for the control. Default empty. 3153 * @type string $description Description for the control. Default empty. 3154 * @type array $choices List of choices for 'radio' or 'select' type controls, where values 3155 * are the keys, and labels are the values. Default empty array. 3156 * @type array $input_attrs List of custom input attributes for control output, where attribute 3157 * names are the keys and values are the values. Default empty array. 3158 * @type bool $allow_addition Show UI for adding new content, currently only used for the 3159 * dropdown-pages control. Default false. 3160 * @type string $type The type of the control. Default 'text'. 3161 * @type callback $active_callback Active callback. 3162 * } 3083 3163 * @return WP_Customize_Control The instance of the control that was added. 3084 3164 */ 3085 3165 public function add_control( $id, $args = array() ) { … … final class WP_Customize_Manager { 3097 3177 * Retrieve a customize control. 3098 3178 * 3099 3179 * @since 3.4.0 3180 * @access public 3100 3181 * 3101 3182 * @param string $id ID of the control. 3102 3183 * @return WP_Customize_Control|void The control object, if set. … … final class WP_Customize_Manager { 3110 3191 * Remove a customize control. 3111 3192 * 3112 3193 * @since 3.4.0 3194 * @access public 3113 3195 * 3114 3196 * @param string $id ID of the control. 3115 3197 */ … … final class WP_Customize_Manager { 3161 3243 * 3162 3244 * @since 3.4.0 3163 3245 * @deprecated 4.7.0 Use wp_list_sort() 3246 * @access protected 3164 3247 * 3165 3248 * @param WP_Customize_Panel|WP_Customize_Section|WP_Customize_Control $a Object A. 3166 3249 * @param WP_Customize_Panel|WP_Customize_Section|WP_Customize_Control $b Object B. … … final class WP_Customize_Manager { 3184 3267 * and sort by priority. 3185 3268 * 3186 3269 * @since 3.4.0 3270 * @access public 3187 3271 */ 3188 3272 public function prepare_controls() { 3189 3273 … … final class WP_Customize_Manager { 3265 3349 * Enqueue scripts for customize controls. 3266 3350 * 3267 3351 * @since 3.4.0 3352 * @access public 3268 3353 */ 3269 3354 public function enqueue_control_scripts() { 3270 3355 foreach ( $this->controls as $control ) { … … final class WP_Customize_Manager { 3478 3563 * Get nonces for the Customizer. 3479 3564 * 3480 3565 * @since 4.5.0 3566 * @access public 3567 * 3481 3568 * @return array Nonces. 3482 3569 */ 3483 3570 public function get_nonces() { … … final class WP_Customize_Manager { 3504 3591 * Print JavaScript settings for parent window. 3505 3592 * 3506 3593 * @since 4.4.0 3594 * @access public 3507 3595 */ 3508 3596 public function customize_pane_settings() { 3509 3597 … … final class WP_Customize_Manager { 3618 3706 /** 3619 3707 * Returns a list of devices to allow previewing. 3620 3708 * 3621 * @access public3622 3709 * @since 4.5.0 3710 * @access public 3623 3711 * 3624 3712 * @return array List of devices with labels and default setting. 3625 3713 */ … … final class WP_Customize_Manager { 3655 3743 * Register some default controls. 3656 3744 * 3657 3745 * @since 3.4.0 3746 * @access public 3658 3747 */ 3659 3748 public function register_controls() { 3660 3749 … … final class WP_Customize_Manager { 4170 4259 * 4171 4260 * Used as active callback for static front page section and controls. 4172 4261 * 4173 * @access private4174 4262 * @since 4.7.0 4263 * @access public 4175 4264 * 4176 4265 * @returns bool Whether there are published (or to be published) pages. 4177 4266 */ … … final class WP_Customize_Manager { 4208 4297 * Returns default text color if hex color is empty. 4209 4298 * 4210 4299 * @since 3.4.0 4300 * @access public 4211 4301 * 4212 4302 * @param string $color 4213 4303 * @return mixed … … final class WP_Customize_Manager { 4227 4317 * Callback for validating a background setting value. 4228 4318 * 4229 4319 * @since 4.7.0 4230 * @access p rivate4320 * @access public 4231 4321 * 4232 4322 * @param string $value Repeat value. 4233 4323 * @param WP_Customize_Setting $setting Setting. … … final class WP_Customize_Manager { 4270 4360 * Export header video settings to facilitate selective refresh. 4271 4361 * 4272 4362 * @since 4.7.0 4363 * @access public 4273 4364 * 4274 4365 * @param array $response Response. 4275 4366 * @param WP_Customize_Selective_Refresh $selective_refresh Selective refresh component. … … final class WP_Customize_Manager { 4290 4381 * Ensures that the selected video is less than 8MB and provides an error message. 4291 4382 * 4292 4383 * @since 4.7.0 4384 * @access public 4293 4385 * 4294 4386 * @param WP_Error $validity 4295 4387 * @param mixed $value … … final class WP_Customize_Manager { 4322 4414 * Ensures that the provided URL is supported. 4323 4415 * 4324 4416 * @since 4.7.0 4417 * @access public 4325 4418 * 4326 4419 * @param WP_Error $validity 4327 4420 * @param mixed $value … … final class WP_Customize_Manager { 4341 4434 * Callback for sanitizing the external_header_video value. 4342 4435 * 4343 4436 * @since 4.7.1 4437 * @access public 4344 4438 * 4345 4439 * @param string $value URL. 4346 4440 * @return string Sanitized URL. … … final class WP_Customize_Manager { 4361 4455 * @see WP_Customize_Manager::register_controls() 4362 4456 * 4363 4457 * @since 4.5.0 4364 * @access p rivate4458 * @access public 4365 4459 * 4366 4460 * @return string Custom logo. 4367 4461 */ -
src/wp-includes/class-wp-customize-setting.php
diff --git src/wp-includes/class-wp-customize-setting.php src/wp-includes/class-wp-customize-setting.php index 83a5b76d61..2e062db111 100644
18 18 */ 19 19 class WP_Customize_Setting { 20 20 /** 21 * Customizer bootstrap instance. 22 * 23 * @since 3.4.0 21 24 * @access public 22 25 * @var WP_Customize_Manager 23 26 */ … … class WP_Customize_Setting { 26 29 /** 27 30 * Unique string identifier for the setting. 28 31 * 32 * @since 3.4.0 29 33 * @access public 30 34 * @var string 31 35 */ 32 36 public $id; 33 37 34 38 /** 39 * Type of customize settings. 40 * 41 * @since 3.4.0 35 42 * @access public 36 43 * @var string 37 44 */ … … class WP_Customize_Setting { 40 47 /** 41 48 * Capability required to edit this setting. 42 49 * 43 * @var string 50 * @since 3.4.0 51 * @access public 52 * @var string|array 44 53 */ 45 54 public $capability = 'edit_theme_options'; 46 55 47 56 /** 48 57 * Feature a theme is required to support to enable this setting. 49 58 * 59 * @since 3.4.0 60 * @access public 61 * @var string 62 */ 63 public $theme_supports = ''; 64 65 /** 66 * The default value for the setting. 67 * 68 * @since 3.4.0 69 * @access public 70 * @var string 71 */ 72 public $default = ''; 73 74 /** 75 * Options for rendering the live preview of changes in Theme Customizer. 76 * 77 * Set this value to 'postMessage' to enable a custom Javascript handler to render changes to this setting 78 * as opposed to reloading the whole page. 79 * 80 * @link https://developer.wordpress.org/themes/customize-api 81 * 82 * @since 3.4.0 50 83 * @access public 51 84 * @var string 52 85 */ 53 public $theme_supports = ''; 54 public $default = ''; 55 public $transport = 'refresh'; 86 public $transport = 'refresh'; 87 88 /** 89 * Server-side validation callback for the setting's value. 90 * 91 * @since 4.6.0 92 * @access public 93 * @var callable 94 */ 95 public $validate_callback = ''; 96 97 /** 98 * Callback to filter a Customize setting value in un-slashed form. 99 * 100 * @since 3.4.0 101 * @access public 102 * @var callable 103 */ 104 public $sanitize_callback = ''; 56 105 57 106 /** 58 * Server-side sanitization callback for the setting's value.107 * Callback to convert a Customize PHP setting value to a value that is JSON serializable. 59 108 * 60 * @var callback 109 * @since 3.4.0 110 * @access public 111 * @var string 61 112 */ 62 public $validate_callback = '';63 public $sanitize_callback = '';64 113 public $sanitize_js_callback = ''; 65 114 66 115 /** … … class WP_Customize_Setting { 78 127 public $dirty = false; 79 128 80 129 /** 130 * @access protected 81 131 * @var array 82 132 */ 83 133 protected $id_data = array(); … … class WP_Customize_Setting { 95 145 * Cache of multidimensional values to improve performance. 96 146 * 97 147 * @since 4.4.0 148 * @static 98 149 * @access protected 99 150 * @var array 100 * @static101 151 */ 102 152 protected static $aggregated_multidimensionals = array(); 103 153 … … class WP_Customize_Setting { 116 166 * Any supplied $args override class property defaults. 117 167 * 118 168 * @since 3.4.0 169 * @access public 119 170 * 120 171 * @param WP_Customize_Manager $manager 121 172 * @param string $id An specific ID of the setting. Can be a … … class WP_Customize_Setting { 252 303 * 253 304 * @see WP_Customize_Setting::preview() 254 305 * @since 4.1.1 306 * @access protected 255 307 * @var mixed 256 308 */ 257 309 protected $_original_value; … … class WP_Customize_Setting { 379 431 * is called for this setting. 380 432 * 381 433 * @since 4.4.0 382 * @access private 434 * @access public 435 * 383 436 * @see WP_Customize_Manager::set_post_value() 384 437 * @see WP_Customize_Setting::_multidimensional_preview_filter() 385 438 */ … … class WP_Customize_Setting { 395 448 * the original value. 396 449 * 397 450 * @since 3.4.0 451 * @access public 398 452 * 399 453 * @param mixed $original Old value. 400 454 * @return mixed New or old value. … … class WP_Customize_Setting { 426 480 * the first setting previewed will be used to apply the values for the others. 427 481 * 428 482 * @since 4.4.0 429 * @access p rivate483 * @access public 430 484 * 431 485 * @see WP_Customize_Setting::$aggregated_multidimensionals 432 486 * @param mixed $original Original root value. … … class WP_Customize_Setting { 468 522 * the value of the setting. 469 523 * 470 524 * @since 3.4.0 471 *472 525 * @access public 473 526 * 474 527 * @return false|void False if cap check fails or value isn't set or is invalid. … … class WP_Customize_Setting { 503 556 * During a save request prior to save, post_value() provides the new value while value() does not. 504 557 * 505 558 * @since 3.4.0 559 * @access public 506 560 * 507 561 * @param mixed $default A default value which is used as a fallback. Default is null. 508 562 * @return mixed The default value on failure, otherwise the sanitized and validated value. … … class WP_Customize_Setting { 515 569 * Sanitize an input. 516 570 * 517 571 * @since 3.4.0 572 * @access public 518 573 * 519 574 * @param string|array $value The value to sanitize. 520 575 * @return string|array|null|WP_Error Sanitized value, or `null`/`WP_Error` if invalid. … … class WP_Customize_Setting { 633 688 * Save the value of the setting, using the related API. 634 689 * 635 690 * @since 3.4.0 691 * @access protected 636 692 * 637 693 * @param mixed $value The value to update. 638 694 * @return bool The result of saving the value. … … class WP_Customize_Setting { 671 727 * 672 728 * @since 3.4.0 673 729 * @deprecated 4.4.0 Deprecated in favor of update() method. 730 * @access protected 674 731 */ 675 732 protected function _update_theme_mod() { 676 733 _deprecated_function( __METHOD__, '4.4.0', __CLASS__ . '::update()' ); … … class WP_Customize_Setting { 681 738 * 682 739 * @since 3.4.0 683 740 * @deprecated 4.4.0 Deprecated in favor of update() method. 741 * @access protected 684 742 */ 685 743 protected function _update_option() { 686 744 _deprecated_function( __METHOD__, '4.4.0', __CLASS__ . '::update()' ); … … class WP_Customize_Setting { 690 748 * Fetch the value of the setting. 691 749 * 692 750 * @since 3.4.0 751 * @access public 693 752 * 694 753 * @return mixed The value. 695 754 */ … … class WP_Customize_Setting { 743 802 * Sanitize the setting's value for use in JavaScript. 744 803 * 745 804 * @since 3.4.0 805 * @access public 746 806 * 747 807 * @return mixed The requested escaped value. 748 808 */ … … class WP_Customize_Setting { 787 847 * Validate user capabilities whether the theme supports the setting. 788 848 * 789 849 * @since 3.4.0 850 * @access public 790 851 * 791 852 * @return bool False if theme doesn't support the setting or user can't change setting, otherwise true. 792 853 */ … … class WP_Customize_Setting { 804 865 * Multidimensional helper function. 805 866 * 806 867 * @since 3.4.0 868 * @access protected 807 869 * 808 870 * @param $root 809 871 * @param $keys … … class WP_Customize_Setting { 854 916 * Will attempt to replace a specific value in a multidimensional array. 855 917 * 856 918 * @since 3.4.0 919 * @access protected 857 920 * 858 921 * @param $root 859 922 * @param $keys … … class WP_Customize_Setting { 878 941 * Will attempt to fetch a specific value from a multidimensional array. 879 942 * 880 943 * @since 3.4.0 944 * @access protected 881 945 * 882 946 * @param $root 883 947 * @param $keys … … class WP_Customize_Setting { 896 960 * Will attempt to check if a specific value in a multidimensional array is set. 897 961 * 898 962 * @since 3.4.0 963 * @access protected 899 964 * 900 965 * @param $root 901 966 * @param $keys … … class WP_Customize_Setting { 907 972 } 908 973 } 909 974 910 /** WP_Customize_Filter_Setting class */ 975 /** 976 * WP_Customize_Filter_Setting class. 977 */ 911 978 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-filter-setting.php' ); 912 979 913 /** WP_Customize_Header_Image_Setting class */ 980 /** 981 * WP_Customize_Header_Image_Setting class. 982 */ 914 983 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-setting.php' ); 915 984 916 /** WP_Customize_Background_Image_Setting class */ 985 /** 986 * WP_Customize_Background_Image_Setting class. 987 */ 917 988 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-background-image-setting.php' ); 918 989 919 /** WP_Customize_Nav_Menu_Item_Setting class */ 990 /** 991 * WP_Customize_Nav_Menu_Item_Setting class. 992 */ 920 993 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-setting.php' ); 921 994 922 /** WP_Customize_Nav_Menu_Setting class */ 995 /** 996 * WP_Customize_Nav_Menu_Setting class. 997 */ 923 998 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-setting.php' ); -
src/wp-includes/customize/class-wp-customize-selective-refresh.php
diff --git src/wp-includes/customize/class-wp-customize-selective-refresh.php src/wp-includes/customize/class-wp-customize-selective-refresh.php index 6c04a73698..db0c04fa7b 100644
final class WP_Customize_Selective_Refresh { 91 91 * @access public 92 92 * 93 93 * @param WP_Customize_Partial|string $id Customize Partial object, or Panel ID. 94 * @param array $args Optional. Partial arguments. Default empty array. 94 * @param array $args { 95 * Optional. Array of properties for the new Partials object. Default empty array. 96 * 97 * @type string $type Type of the partial to be created. 98 * @type string $selector The jQuery selector to find the container element for the partial. 99 * @type array $settings IDs for settings tied to the partial. 100 * @type string $primary_setting The ID for the setting that this partial is primarily responsible for 101 * rendering. If not supplied, it will default to the ID of the first setting. 102 * @type string $capability Capability required to edit this partial. 103 * Normally this is empty and the capability is derived from the capabilities 104 * of the associated `$settings`. 105 * @type callable $render_callback Render callback. 106 * Callback is called with one argument, the instance of WP_Customize_Partial. 107 * The callback can either echo the partial or return the partial as a string, 108 * or return false if error. 109 * @type bool $container_inclusive Whether the container element is included in the partial, or if only 110 * the contents are rendered. 111 * @type bool $fallback_refresh Whether to refresh the entire preview in case a partial cannot be refreshed. 112 * A partial render is considered a failure if the render_callback returns 113 * false. 114 * } 95 115 * @return WP_Customize_Partial The instance of the panel that was added. 96 116 */ 97 117 public function add_partial( $id, $args = array() ) {
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)