Ticket #39671: 39671.3.patch
File 39671.3.patch, 9.9 KB (added by , 4 years ago) |
---|
-
src/wp-includes/class-wp-customize-control.php
77 77 public $capability; 78 78 79 79 /** 80 * Order priority to load the control. 81 * 80 82 * @access public 81 83 * @var int 84 * @since 4.8.0 82 85 */ 83 86 public $priority = 10; 84 87 85 88 /** 89 * Section the control belongs to. 90 * 86 91 * @access public 87 92 * @var string 93 * @since 4.8.0 88 94 */ 89 95 public $section = ''; 90 96 91 97 /** 98 * Label for the control. 99 * 92 100 * @access public 93 101 * @var string 102 * @since 4.8.0 94 103 */ 95 104 public $label = ''; 96 105 97 106 /** 107 * Description for the control. 108 * 98 109 * @access public 99 110 * @var string 111 * @since 4.8.0 100 112 */ 101 113 public $description = ''; 102 114 103 115 /** 104 * @todo: Remove choices116 * List of choices for 'radio' or 'select' type controls, where values are the keys, and labels are the values. 105 117 * 106 118 * @access public 107 119 * @var array 120 * @since 4.8.0 108 121 */ 109 122 public $choices = array(); 110 123 111 124 /** 125 * List of custom input attributes for control output, where attribute names are the keys and values are the values. 126 * 127 * Not used for 'checkbox', 'radio', 'select', 'textarea', or 'dropdown-pages' control types. 128 * 112 129 * @access public 113 130 * @var array 131 * @since 4.8.0 114 132 */ 115 133 public $input_attrs = array(); 116 134 -
src/wp-includes/class-wp-customize-manager.php
2795 2795 * @access public 2796 2796 * 2797 2797 * @param WP_Customize_Setting|string $id Customize Setting object, or ID. 2798 * @param array $args Setting arguments; passed to WP_Customize_Setting 2799 * constructor. 2798 * @param array $args { 2799 * Optional. Array of properties for the new WP_Customize_Setting. Default empty array. 2800 * 2801 * @type string $type Type of the setting. Default 'theme_mod'. 2802 * Default 160. 2803 * @type string $capability Capability required for the setting. Default 'edit_theme_options' 2804 * @type string|array $theme_supports Theme features required to support the panel. Default is none. 2805 * @type string $default Default value for the setting. Default is empty string. 2806 * @type string $transport Options for rendering the live preview of changes in Theme Customizer. 2807 * Using 'refresh' makes the change visible by reloading the whole preview. 2808 * Using 'postMessage' allows a custom JavaScript to handle live changes. 2809 * @link https://developer.wordpress.org/themes/customize-api 2810 * Default is 'refresh' 2811 * @type callable $validate_callback Server-side validation callback for the setting's value. 2812 * @type callable $sanitize_callback Callback to filter a Customize setting value in un-slashed form. 2813 * @type callable $sanitize_js_callback Callback to convert a Customize PHP setting value to a value that is JSON serializable. 2814 * @type bool $dirty Whether or not the setting is initially dirty when created. 2815 * } 2800 2816 * @return WP_Customize_Setting The instance of the setting that was added. 2801 2817 */ 2802 2818 public function add_setting( $id, $args = array() ) { … … 2913 2929 * @access public 2914 2930 * 2915 2931 * @param WP_Customize_Panel|string $id Customize Panel object, or Panel ID. 2916 * @param array $args Optional. Panel arguments. Default empty array. 2932 * @param array $args { 2933 * Optional. Array of properties for the new Panel object. Default empty array. 2917 2934 * 2935 * @type int $priority Priority of the panel, defining the display order of panels and sections. 2936 * Default 160. 2937 * @type string $capability Capability required for the panel. Default `edit_theme_options` 2938 * @type string|array $theme_supports Theme features required to support the panel. 2939 * @type string $title Title of the panel to show in UI. 2940 * @type string $description Description to show in the UI. 2941 * @type string $type Type of the panel. 2942 * @type callable $active_callback Active callback. 2943 * 2944 * } 2945 * 2918 2946 * @return WP_Customize_Panel The instance of the panel that was added. 2919 2947 */ 2920 2948 public function add_panel( $id, $args = array() ) { … … 3002 3030 * @access public 3003 3031 * 3004 3032 * @param WP_Customize_Section|string $id Customize Section object, or Section ID. 3005 * @param array $args Section arguments. 3033 * @param array $args { 3034 * Optional. Array of properties for the new Panel object. Default empty array. 3006 3035 * 3036 * @type int $priority Priority of the panel, defining the display order of panels and sections. 3037 * Default 160. 3038 * @type string $panel Priority of the panel, defining the display order of panels and sections. 3039 * @type string $capability Capability required for the panel. Default 'edit_theme_options' 3040 * @type string|array $theme_supports Theme features required to support the panel. 3041 * @type string $title Title of the panel to show in UI. 3042 * @type string $description Description to show in the UI. 3043 * @type string $type Type of the panel. 3044 * @type callable $active_callback Active callback. 3045 * @type bool $description_hidden Hide the description behind a help icon, instead of . Default false. 3046 * } 3047 * 3007 3048 * @return WP_Customize_Section The instance of the section that was added. 3008 3049 */ 3009 3050 public function add_section( $id, $args = array() ) { … … 3078 3119 * @access public 3079 3120 * 3080 3121 * @param WP_Customize_Control|string $id Customize Control object, or ID. 3081 * @param array $args Control arguments; passed to WP_Customize_Control 3082 * constructor. 3122 * @param array $args { 3123 * Optional. Array of properties for the new Control object. Default empty array. 3124 * 3125 * @type array $settings All settings tied to the control. If undefined, defaults to `$setting`. 3126 * IDs in the array correspond to the ID of a registered `WP_Customize_Setting`. 3127 * @type string $setting The primary setting for the control (if there is one). Default is 'default'. 3128 * @type string $capability Capability required to use this control. Normally derived from `$settings`. 3129 * @type int $priority Order priority to load the control. Default 10. 3130 * @type string $section The section this control belongs to. Default empty. 3131 * @type string $label Label for the control. Default empty. 3132 * @type string $description Description for the control. Default empty. 3133 * @type array $choices List of choices for 'radio' or 'select' type controls, where values 3134 * are the keys, and labels are the values. Default empty array. 3135 * @type array $input_attrs List of custom input attributes for control output, where attribute 3136 * names are the keys and values are the values. Default empty array. 3137 * @type bool $allow_addition Show UI for adding new content, currently only used for the 3138 * dropdown-pages control. Default false. 3139 * @type string $type The type of the control. Default 'text'. 3140 * @type callback $active_callback Active callback. 3141 * } 3142 * 3083 3143 * @return WP_Customize_Control The instance of the control that was added. 3084 3144 */ 3085 3145 public function add_control( $id, $args = array() ) { -
src/wp-includes/class-wp-customize-setting.php
40 40 /** 41 41 * Capability required to edit this setting. 42 42 * 43 * @var string 43 * @var string|array 44 44 */ 45 45 public $capability = 'edit_theme_options'; 46 46 … … 51 51 * @var string 52 52 */ 53 53 public $theme_supports = ''; 54 55 /** 56 * The default value for the setting. 57 * 58 * @access public 59 * @var string 60 */ 54 61 public $default = ''; 62 63 /** 64 * Options for rendering the live preview of changes in Theme Customizer. 65 * 66 * Set this value to 'postMessage' to enable a custom Javascript handler to render changes to this setting 67 * as opposed to reloading the whole page. 68 * 69 * @link https://developer.wordpress.org/themes/customize-api 70 * 71 * @access public 72 * @var string 73 */ 55 74 public $transport = 'refresh'; 56 75 57 76 /** 58 * Server-side sanitization callback for the setting's value.77 * Server-side validation callback for the setting's value. 59 78 * 60 * @var call back79 * @var callable 61 80 */ 62 81 public $validate_callback = ''; 82 83 /** 84 * Callback to filter a Customize setting value in un-slashed form. 85 * 86 * @var callable 87 */ 63 88 public $sanitize_callback = ''; 89 90 /** 91 * Callback to convert a Customize PHP setting value to a value that is JSON serializable. 92 * 93 * @var string 94 */ 64 95 public $sanitize_js_callback = ''; 65 96 66 97 /**