Ticket #39671: 39671.5.patch
| File 39671.5.patch, 14.6 KB (added by , 9 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. 98 108 * @access public 99 109 * @var string 110 * @since 4.8.0 100 111 */ 101 112 public $description = ''; 102 113 103 114 /** 104 * @todo: Remove choices115 * List of choices for 'radio' or 'select' type controls, where values are the keys, and labels are the values. 105 116 * 106 117 * @access public 107 118 * @var array 119 * @since 4.8.0 108 120 */ 109 121 public $choices = array(); 110 122 111 123 /** 124 * List of custom input attributes for control output, where attribute names are the keys and values are the values. 125 * 126 * Not used for 'checkbox', 'radio', 'select', 'textarea', or 'dropdown-pages' control types. 127 * 112 128 * @access public 113 129 * @var array 130 * @since 4.8.0 114 131 */ 115 132 public $input_attrs = array(); 116 133 -
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 2814 * JSON serializable. 2815 * @type bool $dirty Whether or not the setting is initially dirty when created. 2816 * } 2800 2817 * @return WP_Customize_Setting The instance of the setting that was added. 2801 2818 */ 2802 2819 public function add_setting( $id, $args = array() ) { … … 2913 2930 * @access public 2914 2931 * 2915 2932 * @param WP_Customize_Panel|string $id Customize Panel object, or Panel ID. 2916 * @param array $args Optional. Panel arguments. Default empty array. 2917 * 2933 * @param array $args { 2934 * Optional. Array of properties for the new Panel object. Default empty array. 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 * } 2918 2944 * @return WP_Customize_Panel The instance of the panel that was added. 2919 2945 */ 2920 2946 public function add_panel( $id, $args = array() ) { … … 3002 3028 * @access public 3003 3029 * 3004 3030 * @param WP_Customize_Section|string $id Customize Section object, or Section ID. 3005 * @param array $args Section arguments. 3006 * 3031 * @param array $args { 3032 * Optional. Array of properties for the new Panel object. Default empty array. 3033 * @type int $priority Priority of the panel, defining the display order of panels and sections. 3034 * Default 160. 3035 * @type string $panel Priority of the panel, defining the display order of panels and sections. 3036 * @type string $capability Capability required for the panel. Default 'edit_theme_options' 3037 * @type string|array $theme_supports Theme features required to support the panel. 3038 * @type string $title Title of the panel to show in UI. 3039 * @type string $description Description to show in the UI. 3040 * @type string $type Type of the panel. 3041 * @type callable $active_callback Active callback. 3042 * @type bool $description_hidden Hide the description behind a help icon, instead of . Default false. 3043 * } 3007 3044 * @return WP_Customize_Section The instance of the section that was added. 3008 3045 */ 3009 3046 public function add_section( $id, $args = array() ) { … … 3078 3115 * @access public 3079 3116 * 3080 3117 * @param WP_Customize_Control|string $id Customize Control object, or ID. 3081 * @param array $args Control arguments; passed to WP_Customize_Control 3082 * constructor. 3118 * @param array $args { 3119 * Optional. Array of properties for the new Control object. Default empty array. 3120 * 3121 * @type array $settings All settings tied to the control. If undefined, defaults to `$setting`. 3122 * IDs in the array correspond to the ID of a registered `WP_Customize_Setting`. 3123 * @type string $setting The primary setting for the control (if there is one). Default is 'default'. 3124 * @type string $capability Capability required to use this control. Normally derived from `$settings`. 3125 * @type int $priority Order priority to load the control. Default 10. 3126 * @type string $section The section this control belongs to. Default empty. 3127 * @type string $label Label for the control. Default empty. 3128 * @type string $description Description for the control. Default empty. 3129 * @type array $choices List of choices for 'radio' or 'select' type controls, where values 3130 * are the keys, and labels are the values. Default empty array. 3131 * @type array $input_attrs List of custom input attributes for control output, where attribute 3132 * names are the keys and values are the values. Default empty array. 3133 * @type bool $allow_addition Show UI for adding new content, currently only used for the 3134 * dropdown-pages control. Default false. 3135 * @type string $type The type of the control. Default 'text'. 3136 * @type callback $active_callback Active callback. 3137 * } 3083 3138 * @return WP_Customize_Control The instance of the control that was added. 3084 3139 */ 3085 3140 public function add_control( $id, $args = array() ) { -
src/wp-includes/class-wp-customize-setting.php
18 18 */ 19 19 class WP_Customize_Setting { 20 20 /** 21 * @since 4.8.0 21 22 * @access public 22 23 * @var WP_Customize_Manager 23 24 */ … … 26 27 /** 27 28 * Unique string identifier for the setting. 28 29 * 30 * @since 4.8.0 29 31 * @access public 30 32 * @var string 31 33 */ 32 34 public $id; 33 35 34 36 /** 37 * @since 4.8.0 35 38 * @access public 36 39 * @var string 37 40 */ … … 40 43 /** 41 44 * Capability required to edit this setting. 42 45 * 43 * @var string 46 * @since 4.8.0 47 * @var string|array 44 48 */ 45 49 public $capability = 'edit_theme_options'; 46 50 47 51 /** 48 52 * Feature a theme is required to support to enable this setting. 49 53 * 54 * @since 4.8.0 50 55 * @access public 51 56 * @var string 52 57 */ 53 58 public $theme_supports = ''; 59 60 /** 61 * The default value for the setting. 62 * 63 * @since 4.8.0 64 * @access public 65 * @var string 66 */ 54 67 public $default = ''; 68 69 /** 70 * Options for rendering the live preview of changes in Theme Customizer. 71 * 72 * Set this value to 'postMessage' to enable a custom Javascript handler to render changes to this setting 73 * as opposed to reloading the whole page. 74 * 75 * @link https://developer.wordpress.org/themes/customize-api 76 * 77 * @since 4.8.0 78 * @access public 79 * @var string 80 */ 55 81 public $transport = 'refresh'; 56 82 57 83 /** 58 * Server-side sanitization callback for the setting's value.84 * Server-side validation callback for the setting's value. 59 85 * 60 * @var callback 86 * @since 4.8.0 87 * @var callable 61 88 */ 62 89 public $validate_callback = ''; 90 91 /** 92 * Callback to filter a Customize setting value in un-slashed form. 93 * 94 * @since 4.8.0 95 * @var callable 96 */ 63 97 public $sanitize_callback = ''; 98 99 /** 100 * Callback to convert a Customize PHP setting value to a value that is JSON serializable. 101 * 102 * @since 4.8.0 103 * @var string 104 */ 64 105 public $sanitize_js_callback = ''; 65 106 66 107 /** -
src/wp-includes/customize/class-wp-customize-selective-refresh.php
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() ) { -
src/wp-includes/kses.php
549 549 $allowed_html = wp_kses_allowed_html( 'post' ); 550 550 $allowed_protocols = wp_allowed_protocols(); 551 551 $string = wp_kses_no_null( $string, array( 'slash_zero' => 'keep' ) ); 552 552 553 553 // Preserve leading and trailing whitespace. 554 554 $matches = array(); 555 555 preg_match('/^\s*/', $string, $matches); … … 561 561 } else { 562 562 $string = substr( $string, strlen( $lead ), -strlen( $trail ) ); 563 563 } 564 564 565 565 // Parse attribute name and value from input. 566 566 $split = preg_split( '/\s*=\s*/', $string, 2 ); 567 567 $name = $split[0]; … … 598 598 $value = ''; 599 599 $vless = 'y'; 600 600 } 601 601 602 602 // Sanitize attribute by name. 603 603 wp_kses_attr_check( $name, $value, $string, $vless, $element, $allowed_html ); 604 604 … … 633 633 * @param string $context Context to judge allowed tags by. Allowed values are 'post', 634 634 * 'data', 'strip', 'entities', 'explicit', or the name of a filter. 635 635 */ 636 return apply_filters( 'wp_kses_allowed_html', $ context, 'explicit' );636 return apply_filters( 'wp_kses_allowed_html', $tags, 'explicit' ); 637 637 } 638 638 639 639 switch ( $context ) { … … 1061 1061 } else { 1062 1062 $xhtml_slash = ''; 1063 1063 } 1064 1064 1065 1065 // Split it 1066 1066 $attrarr = wp_kses_hair_parse( $attr ); 1067 1067 if ( false === $attrarr ) { … … 1071 1071 // Make sure all input is returned by adding front and back matter. 1072 1072 array_unshift( $attrarr, $begin . $slash . $elname ); 1073 1073 array_push( $attrarr, $xhtml_slash . $end ); 1074 1074 1075 1075 return $attrarr; 1076 1076 } 1077 1077
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)