Ticket #39671: 39671-2.patch
| File 39671-2.patch, 26.2 KB (added by , 9 years ago) |
|---|
-
wp-includes/class-wp-customize-control.php
diff --git wp-includes/class-wp-customize-control.php wp-includes/class-wp-customize-control.php index 07c6dcfce..3851fc0aa 100644
class WP_Customize_Control { 77 77 public $capability; 78 78 79 79 /** 80 * Order priority to load the control. 81 * 80 82 * @access public 81 83 * @var int 82 84 */ 83 85 public $priority = 10; 84 86 85 87 /** 88 * Section the control belongs to. 89 * 86 90 * @access public 87 91 * @var string 88 92 */ 89 93 public $section = ''; 90 94 91 95 /** 96 * Label for the control. 97 * 92 98 * @access public 93 99 * @var string 94 100 */ 95 101 public $label = ''; 96 102 97 103 /** 104 * Description for the control. 105 * 98 106 * @access public 99 107 * @var string 100 108 */ … … class WP_Customize_Control { 102 110 103 111 /** 104 112 * @todo: Remove choices 113 * List of choices for 'radio' or 'select' type controls, where values are the keys, and labels are the values. 105 114 * 106 115 * @access public 107 116 * @var array … … class WP_Customize_Control { 109 118 public $choices = array(); 110 119 111 120 /** 121 * List of custom input attributes for control output, where attribute names are the keys and values are the values. 122 * 123 * Not used for 'checkbox', 'radio', 'select', 'textarea', or 'dropdown-pages' control types. 124 * 112 125 * @access public 113 126 * @var array 114 127 */ -
wp-includes/class-wp-customize-manager.php
diff --git wp-includes/class-wp-customize-manager.php wp-includes/class-wp-customize-manager.php index 229a2484b..64015ec40 100644
final class WP_Customize_Manager { 2793 2793 * @access public 2794 2794 * 2795 2795 * @param WP_Customize_Setting|string $id Customize Setting object, or ID. 2796 * @param array $args Setting arguments; passed to WP_Customize_Setting 2797 * constructor. 2796 * @param array $args { 2797 * Optional. Array of properties for the new WP_Customize_Setting. Default empty array. 2798 * 2799 * @type string $type Type of the setting. Default 'theme_mod'. 2800 * Default 160. 2801 * @type string $capability Capability required for the setting. Default 'edit_theme_options' 2802 * @type string|array $theme_supports Theme features required to support the panel. Default is none. 2803 * @type string $default Default value for the setting. Default is empty string. 2804 * @type string $transport Options for rendering the live preview of changes in Theme Customizer. 2805 * Using 'refresh' makes the change visible by reloading the whole preview. 2806 * Using 'postMessage' allows a custom JavaScript to handle live changes. 2807 * @see https://codex.wordpress.org/Theme_Customization_API 2808 * Default is 'refresh' 2809 * @type callable $validate_callback Server-side validation callback for the setting's value. 2810 * @type callable $sanitize_callback Callback to filter a Customize setting value in un-slashed form. 2811 * @type callable $sanitize_js_callback Callback to convert a Customize PHP setting value to a value that is 2812 * JSON serializable. 2813 * @type bool $dirty Whether or not the setting is initially dirty when created. 2814 * } 2798 2815 * @return WP_Customize_Setting The instance of the setting that was added. 2799 2816 */ 2800 2817 public function add_setting( $id, $args = array() ) { … … final class WP_Customize_Manager { 2911 2928 * @access public 2912 2929 * 2913 2930 * @param WP_Customize_Panel|string $id Customize Panel object, or Panel ID. 2914 * @param array $args Optional. Panel arguments. Default empty array. 2931 * @param array $args { 2932 * Optional. Array of properties for the new Panel object. Default empty array. 2933 * 2934 * @type int $priority Priority of the panel, defining the display order of panels and sections. 2935 * Default 160. 2936 * @type string $capability Capability required for the panel. Default `edit_theme_options` 2937 * @type string|array $theme_supports Theme features required to support the panel. 2938 * @type string $title Title of the panel to show in UI. 2939 * @type string $description Description to show in the UI. 2940 * @type string $type Type of the panel. 2941 * @type callable $active_callback Active callback. 2942 * } 2915 2943 * 2916 2944 * @return WP_Customize_Panel The instance of the panel that was added. 2917 2945 */ … … final class WP_Customize_Manager { 3000 3028 * @access public 3001 3029 * 3002 3030 * @param WP_Customize_Section|string $id Customize Section object, or Section ID. 3003 * @param array $args Section arguments. 3031 * @param array $args { 3032 * Optional. Array of properties for the new Panel object. Default empty array. 3033 * 3034 * @type int $priority Priority of the panel, defining the display order of panels and sections. 3035 * Default 160. 3036 * @type string $panel Priority of the panel, defining the display order of panels and sections. 3037 * @type string $capability Capability required for the panel. Default 'edit_theme_options' 3038 * @type string|array $theme_supports Theme features required to support the panel. 3039 * @type string $title Title of the panel to show in UI. 3040 * @type string $description Description to show in the UI. 3041 * @type string $type Type of the panel. 3042 * @type callable $active_callback Active callback. 3043 * @type bool $description_hidden Hide the description behind a help icon, instead of . Default false. 3044 * } 3004 3045 * 3005 3046 * @return WP_Customize_Section The instance of the section that was added. 3006 3047 */ … … final class WP_Customize_Manager { 3076 3117 * @access public 3077 3118 * 3078 3119 * @param WP_Customize_Control|string $id Customize Control object, or ID. 3079 * @param array $args Control arguments; passed to WP_Customize_Control 3080 * constructor. 3120 * @param array $args { 3121 * Optional. Array of properties for the new Control object. Default empty array. 3122 * 3123 * @type array $settings All settings tied to the control. If undefined, defaults to `$setting`. 3124 * IDs in the array correspond to the ID of a registered `WP_Customize_Setting`. 3125 * @type string $setting The primary setting for the control (if there is one). Default is 'default'. 3126 * @type string $capability Capability required to use this control. Normally derived from `$settings`. 3127 * @type int $priority Order priority to load the control. Default 10. 3128 * @type string $section The section this control belongs to. Default empty. 3129 * @type string $label Label for the control. Default empty. 3130 * @type string $description Description for the control. Default empty. 3131 * @type array $choices List of choices for 'radio' or 'select' type controls, where values 3132 * are the keys, and labels are the values. Default empty array. 3133 * @type array $input_attrs List of custom input attributes for control output, where attribute 3134 * names are the keys and values are the values. Default empty array. 3135 * @type bool $allow_addition Show UI for adding new content, currently only used for the 3136 * dropdown-pages control. Default false. 3137 * @type string $type The type of the control. Default 'text'. 3138 * @type callback $active_callback Active callback. 3139 * } 3140 * 3081 3141 * @return WP_Customize_Control The instance of the control that was added. 3082 3142 */ 3083 3143 public function add_control( $id, $args = array() ) { -
wp-includes/class-wp-customize-setting.php
diff --git wp-includes/class-wp-customize-setting.php wp-includes/class-wp-customize-setting.php index 83a5b76d6..566c5485d 100644
class WP_Customize_Setting { 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 … … class WP_Customize_Setting { 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 * @see https://codex.wordpress.org/Theme_Customization_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 callable 94 */ 64 95 public $sanitize_js_callback = ''; 65 96 66 97 /** -
wp-includes/customize/class-wp-customize-selective-refresh.php
diff --git wp-includes/customize/class-wp-customize-selective-refresh.php wp-includes/customize/class-wp-customize-selective-refresh.php index 23d5a9488..32c201d8e 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. Default 'default'. 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. If undefined, `$id` will be used. 100 * IDs in the array correspond to the ID of a registered instance 101 * of `WP_Customize_Setting` 102 * @type string $primary_setting The ID for the setting that this partial is primarily responsible for 103 * rendering. If not supplied, it will default to the ID of the first setting. 104 * @type string $capability Capability required to edit this partial. 105 * Normally this is empty and the capability is derived from the capabilities 106 * of the associated `$settings`. 107 * @type callable $render_callback Render callback. 108 * Callback is called with one argument, the instance of WP_Customize_Partial. 109 * The callback can either echo the partial or return the partial as a string, 110 * or return false if error. 111 * @type bool $container_inclusive Whether the container element is included in the partial, or if only 112 * the contents are rendered. Default false. 113 * @type bool $fallback_refresh Whether to refresh the entire preview in case a partial cannot be refreshed. 114 * A partial render is considered a failure if the render_callback returns 115 * false. Default true. 116 * } 117 * 95 118 * @return WP_Customize_Partial The instance of the panel that was added. 96 119 */ 97 120 public function add_partial( $id, $args = array() ) {
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)