Changeset 40804
- Timestamp:
- 05/19/2017 08:24:58 PM (8 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-customize-control.php
r39345 r40804 38 38 39 39 /** 40 * Customizer manager. 41 * 42 * @since 3.4.0 40 43 * @access public 41 44 * @var WP_Customize_Manager … … 44 47 45 48 /** 49 * Control ID. 50 * 51 * @since 3.4.0 46 52 * @access public 47 53 * @var string … … 52 58 * All settings tied to the control. 53 59 * 60 * @since 3.4.0 54 61 * @access public 55 62 * @var array … … 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 … … 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 … … 84 95 85 96 /** 97 * Section the control belongs to. 98 * 99 * @since 3.4.0 86 100 * @access public 87 101 * @var string … … 90 104 91 105 /** 106 * Label for the control. 107 * 108 * @since 3.4.0 92 109 * @access public 93 110 * @var string … … 96 113 97 114 /** 115 * Description for the control. 116 * 117 * @since 4.0.0 98 118 * @access public 99 119 * @var string … … 102 122 103 123 /** 104 * @todo: Remove choices 105 * 124 * List of choices for 'radio' or 'select' type controls, where values are the keys, and labels are the values. 125 * 126 * @since 3.4.0 106 127 * @access public 107 128 * @var 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 … … 126 152 /** 127 153 * @deprecated It is better to just call the json() method 154 * @since 3.4.0 128 155 * @access public 129 156 * @var array … … 132 159 133 160 /** 161 * Control's Type. 162 * 163 * @since 3.4.0 134 164 * @access public 135 165 * @var string … … 236 266 * 237 267 * @since 4.0.0 238 * @access public239 268 * 240 269 * @return bool Whether the control is active to the current preview. … … 264 293 * 265 294 * @since 4.0.0 266 * @access public267 295 * 268 296 * @return true Always true. … … 447 475 * 448 476 * @since 4.0.0 449 * @access public450 477 */ 451 478 public function input_attrs() { … … 649 676 } 650 677 651 /** WP_Customize_Color_Control class */ 678 /** 679 * WP_Customize_Color_Control class. 680 */ 652 681 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-color-control.php' ); 653 682 654 /** WP_Customize_Media_Control class */ 683 /** 684 * WP_Customize_Media_Control class. 685 */ 655 686 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-media-control.php' ); 656 687 657 /** WP_Customize_Upload_Control class */ 688 /** 689 * WP_Customize_Upload_Control class. 690 */ 658 691 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-upload-control.php' ); 659 692 660 /** WP_Customize_Image_Control class */ 693 /** 694 * WP_Customize_Image_Control class. 695 */ 661 696 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-image-control.php' ); 662 697 663 /** WP_Customize_Background_Image_Control class */ 698 /** 699 * WP_Customize_Background_Image_Control class. 700 */ 664 701 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-background-image-control.php' ); 665 702 666 /** WP_Customize_Background_Position_Control class */ 703 /** 704 * WP_Customize_Background_Position_Control class. 705 */ 667 706 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-background-position-control.php' ); 668 707 669 /** WP_Customize_Cropped_Image_Control class */ 708 /** 709 * WP_Customize_Cropped_Image_Control class. 710 */ 670 711 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-cropped-image-control.php' ); 671 712 672 /** WP_Customize_Site_Icon_Control class */ 713 /** 714 * WP_Customize_Site_Icon_Control class. 715 */ 673 716 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-site-icon-control.php' ); 674 717 675 /** WP_Customize_Header_Image_Control class */ 718 /** 719 * WP_Customize_Header_Image_Control class. 720 */ 676 721 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-control.php' ); 677 722 678 /** WP_Customize_Theme_Control class */ 723 /** 724 * WP_Customize_Theme_Control class. 725 */ 679 726 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-theme-control.php' ); 680 727 681 /** WP_Widget_Area_Customize_Control class */ 728 /** 729 * WP_Widget_Area_Customize_Control class. 730 */ 682 731 require_once( ABSPATH . WPINC . '/customize/class-wp-widget-area-customize-control.php' ); 683 732 684 /** WP_Widget_Form_Customize_Control class */ 733 /** 734 * WP_Widget_Form_Customize_Control class. 735 */ 685 736 require_once( ABSPATH . WPINC . '/customize/class-wp-widget-form-customize-control.php' ); 686 737 687 /** WP_Customize_Nav_Menu_Control class */ 738 /** 739 * WP_Customize_Nav_Menu_Control class. 740 */ 688 741 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-control.php' ); 689 742 690 /** WP_Customize_Nav_Menu_Item_Control class */ 743 /** 744 * WP_Customize_Nav_Menu_Item_Control class. 745 */ 691 746 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-control.php' ); 692 747 693 /** WP_Customize_Nav_Menu_Location_Control class */ 748 /** 749 * WP_Customize_Nav_Menu_Location_Control class. 750 */ 694 751 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-location-control.php' ); 695 752 696 /** WP_Customize_Nav_Menu_Name_Control class */ 753 /** 754 * WP_Customize_Nav_Menu_Name_Control class. 755 */ 697 756 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-name-control.php' ); 698 757 699 /** WP_Customize_Nav_Menu_Auto_Add_Control class */ 758 /** 759 * WP_Customize_Nav_Menu_Auto_Add_Control class. 760 */ 700 761 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-auto-add-control.php' ); 701 762 702 /** WP_Customize_New_Menu_Control class */ 763 /** 764 * WP_Customize_New_Menu_Control class. 765 */ 703 766 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-new-menu-control.php' ); -
trunk/src/wp-includes/class-wp-customize-manager.php
r40704 r40804 2811 2811 * @since 3.4.0 2812 2812 * @since 4.5.0 Return added WP_Customize_Setting instance. 2813 * @access public2814 2813 * 2815 2814 * @param WP_Customize_Setting|string $id Customize Setting object, or ID. 2816 * @param array $args Setting arguments; passed to WP_Customize_Setting 2817 * constructor. 2815 * @param array $args { 2816 * Optional. Array of properties for the new WP_Customize_Setting. Default empty array. 2817 * 2818 * @type string $type Type of the setting. Default 'theme_mod'. 2819 * Default 160. 2820 * @type string $capability Capability required for the setting. Default 'edit_theme_options' 2821 * @type string|array $theme_supports Theme features required to support the panel. Default is none. 2822 * @type string $default Default value for the setting. Default is empty string. 2823 * @type string $transport Options for rendering the live preview of changes in Theme Customizer. 2824 * Using 'refresh' makes the change visible by reloading the whole preview. 2825 * Using 'postMessage' allows a custom JavaScript to handle live changes. 2826 * @link https://developer.wordpress.org/themes/customize-api 2827 * Default is 'refresh' 2828 * @type callable $validate_callback Server-side validation callback for the setting's value. 2829 * @type callable $sanitize_callback Callback to filter a Customize setting value in un-slashed form. 2830 * @type callable $sanitize_js_callback Callback to convert a Customize PHP setting value to a value that is 2831 * JSON serializable. 2832 * @type bool $dirty Whether or not the setting is initially dirty when created. 2833 * } 2818 2834 * @return WP_Customize_Setting The instance of the setting that was added. 2819 2835 */ … … 2929 2945 * @since 4.0.0 2930 2946 * @since 4.5.0 Return added WP_Customize_Panel instance. 2931 * @access public2932 2947 * 2933 2948 * @param WP_Customize_Panel|string $id Customize Panel object, or Panel ID. 2934 * @param array $args Optional. Panel arguments. Default empty array. 2935 * 2949 * @param array $args { 2950 * Optional. Array of properties for the new Panel object. Default empty array. 2951 * @type int $priority Priority of the panel, defining the display order of panels and sections. 2952 * Default 160. 2953 * @type string $capability Capability required for the panel. Default `edit_theme_options` 2954 * @type string|array $theme_supports Theme features required to support the panel. 2955 * @type string $title Title of the panel to show in UI. 2956 * @type string $description Description to show in the UI. 2957 * @type string $type Type of the panel. 2958 * @type callable $active_callback Active callback. 2959 * } 2936 2960 * @return WP_Customize_Panel The instance of the panel that was added. 2937 2961 */ … … 3021 3045 * 3022 3046 * @param WP_Customize_Section|string $id Customize Section object, or Section ID. 3023 * @param array $args Section arguments. 3024 * 3047 * @param array $args { 3048 * Optional. Array of properties for the new Panel object. Default empty array. 3049 * @type int $priority Priority of the panel, defining the display order of panels and sections. 3050 * Default 160. 3051 * @type string $panel Priority of the panel, defining the display order of panels and sections. 3052 * @type string $capability Capability required for the panel. Default 'edit_theme_options' 3053 * @type string|array $theme_supports Theme features required to support the panel. 3054 * @type string $title Title of the panel to show in UI. 3055 * @type string $description Description to show in the UI. 3056 * @type string $type Type of the panel. 3057 * @type callable $active_callback Active callback. 3058 * @type bool $description_hidden Hide the description behind a help icon, instead of . Default false. 3059 * } 3025 3060 * @return WP_Customize_Section The instance of the section that was added. 3026 3061 */ … … 3097 3132 * 3098 3133 * @param WP_Customize_Control|string $id Customize Control object, or ID. 3099 * @param array $args Control arguments; passed to WP_Customize_Control 3100 * constructor. 3134 * @param array $args { 3135 * Optional. Array of properties for the new Control object. Default empty array. 3136 * 3137 * @type array $settings All settings tied to the control. If undefined, defaults to `$setting`. 3138 * IDs in the array correspond to the ID of a registered `WP_Customize_Setting`. 3139 * @type string $setting The primary setting for the control (if there is one). Default is 'default'. 3140 * @type string $capability Capability required to use this control. Normally derived from `$settings`. 3141 * @type int $priority Order priority to load the control. Default 10. 3142 * @type string $section The section this control belongs to. Default empty. 3143 * @type string $label Label for the control. Default empty. 3144 * @type string $description Description for the control. Default empty. 3145 * @type array $choices List of choices for 'radio' or 'select' type controls, where values 3146 * are the keys, and labels are the values. Default empty array. 3147 * @type array $input_attrs List of custom input attributes for control output, where attribute 3148 * names are the keys and values are the values. Default empty array. 3149 * @type bool $allow_addition Show UI for adding new content, currently only used for the 3150 * dropdown-pages control. Default false. 3151 * @type string $type The type of the control. Default 'text'. 3152 * @type callback $active_callback Active callback. 3153 * } 3101 3154 * @return WP_Customize_Control The instance of the control that was added. 3102 3155 */ … … 3497 3550 * 3498 3551 * @since 4.5.0 3552 * 3499 3553 * @return array Nonces. 3500 3554 */ … … 3637 3691 * Returns a list of devices to allow previewing. 3638 3692 * 3639 * @access public3640 3693 * @since 4.5.0 3641 3694 * … … 4189 4242 * Used as active callback for static front page section and controls. 4190 4243 * 4191 * @access private4192 4244 * @since 4.7.0 4193 4245 * … … 4246 4298 * 4247 4299 * @since 4.7.0 4248 * @access private4249 4300 * 4250 4301 * @param string $value Repeat value. … … 4380 4431 * 4381 4432 * @since 4.5.0 4382 * @access private4383 4433 * 4384 4434 * @return string Custom logo. -
trunk/src/wp-includes/class-wp-customize-setting.php
r40036 r40804 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 … … 27 30 * Unique string identifier for the setting. 28 31 * 32 * @since 3.4.0 29 33 * @access public 30 34 * @var string … … 33 37 34 38 /** 39 * Type of customize settings. 40 * 41 * @since 3.4.0 35 42 * @access public 36 43 * @var string … … 41 48 * Capability required to edit this setting. 42 49 * 50 * @since 3.4.0 51 * @access public 52 * @var string|array 53 */ 54 public $capability = 'edit_theme_options'; 55 56 /** 57 * Feature a theme is required to support to enable this setting. 58 * 59 * @since 3.4.0 60 * @access public 43 61 * @var string 44 62 */ 45 public $capability = 'edit_theme_options'; 46 47 /** 48 * Feature a theme is required to support to enable this setting. 49 * 63 public $theme_supports = ''; 64 65 /** 66 * The default value for the setting. 67 * 68 * @since 3.4.0 50 69 * @access public 51 70 * @var string 52 71 */ 53 public $theme_supports = ''; 54 public $default = ''; 55 public $transport = 'refresh'; 56 57 /** 58 * Server-side sanitization callback for the setting's value. 59 * 60 * @var callback 61 */ 62 public $validate_callback = ''; 63 public $sanitize_callback = ''; 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 83 * @access public 84 * @var string 85 */ 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 = ''; 105 106 /** 107 * Callback to convert a Customize PHP setting value to a value that is JSON serializable. 108 * 109 * @since 3.4.0 110 * @access public 111 * @var string 112 */ 64 113 public $sanitize_js_callback = ''; 65 114 … … 79 128 80 129 /** 130 * ID Data. 131 * 132 * @since 3.4.0 133 * @access protected 81 134 * @var array 82 135 */ … … 96 149 * 97 150 * @since 4.4.0 151 * @static 98 152 * @access protected 99 153 * @var array 100 * @static101 154 */ 102 155 protected static $aggregated_multidimensionals = array(); … … 169 222 * 170 223 * @since 4.4.0 171 * @access public172 224 * 173 225 * @return array { … … 189 241 * 190 242 * @since 4.4.0 191 * @access protected192 243 */ 193 244 protected function aggregate_multidimensional() { … … 217 268 * 218 269 * @since 4.5.0 219 * @access public220 270 * @ignore 221 271 */ … … 237 287 * 238 288 * @since 4.2.0 239 * @access public240 289 * 241 290 * @return bool If preview() has been called. … … 253 302 * @see WP_Customize_Setting::preview() 254 303 * @since 4.1.1 304 * @access protected 255 305 * @var mixed 256 306 */ … … 266 316 * @since 3.4.0 267 317 * @since 4.4.0 Added boolean return value. 268 * @access public269 318 * 270 319 * @return bool False when preview short-circuits due no change needing to be previewed. … … 380 429 * 381 430 * @since 4.4.0 382 * @access private431 * 383 432 * @see WP_Customize_Manager::set_post_value() 384 433 * @see WP_Customize_Setting::_multidimensional_preview_filter() … … 427 476 * 428 477 * @since 4.4.0 429 * @access private430 478 * 431 479 * @see WP_Customize_Setting::$aggregated_multidimensionals … … 470 518 * @since 3.4.0 471 519 * 472 * @access public473 *474 520 * @return false|void False if cap check fails or value isn't set or is invalid. 475 521 */ … … 537 583 * 538 584 * @since 4.6.0 539 * @access public540 585 * 541 586 * @see WP_REST_Request::has_valid_params() … … 579 624 * 580 625 * @since 4.4.0 581 * @access protected582 626 * 583 627 * @param mixed $default Value to return if root does not exist. … … 604 648 * 605 649 * @since 4.4.0 606 * @access protected607 650 * 608 651 * @param mixed $value Value to set as root of multidimensional setting. … … 771 814 * 772 815 * @since 4.6.0 773 * @access public774 816 * 775 817 * @return array Array of parameters passed to JavaScript. … … 908 950 } 909 951 910 /** WP_Customize_Filter_Setting class */ 952 /** 953 * WP_Customize_Filter_Setting class. 954 */ 911 955 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-filter-setting.php' ); 912 956 913 /** WP_Customize_Header_Image_Setting class */ 957 /** 958 * WP_Customize_Header_Image_Setting class. 959 */ 914 960 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-setting.php' ); 915 961 916 /** WP_Customize_Background_Image_Setting class */ 962 /** 963 * WP_Customize_Background_Image_Setting class. 964 */ 917 965 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-background-image-setting.php' ); 918 966 919 /** WP_Customize_Nav_Menu_Item_Setting class */ 967 /** 968 * WP_Customize_Nav_Menu_Item_Setting class. 969 */ 920 970 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-setting.php' ); 921 971 922 /** WP_Customize_Nav_Menu_Setting class */ 972 /** 973 * WP_Customize_Nav_Menu_Setting class. 974 */ 923 975 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-setting.php' ); -
trunk/src/wp-includes/customize/class-wp-customize-selective-refresh.php
r40316 r40804 89 89 * 90 90 * @since 4.5.0 91 * @access public92 91 * 93 92 * @param WP_Customize_Partial|string $id Customize Partial object, or Panel ID. 94 * @param array $args Optional. Partial arguments. Default empty array. 93 * @param array $args { 94 * Optional. Array of properties for the new Partials object. Default empty array. 95 * 96 * @type string $type Type of the partial to be created. 97 * @type string $selector The jQuery selector to find the container element for the partial, that is, a partial's placement. 98 * @type array $settings IDs for settings tied to the partial. 99 * @type string $primary_setting The ID for the setting that this partial is primarily responsible for 100 * rendering. If not supplied, it will default to the ID of the first setting. 101 * @type string $capability Capability required to edit this partial. 102 * Normally this is empty and the capability is derived from the capabilities 103 * of the associated `$settings`. 104 * @type callable $render_callback Render callback. 105 * Callback is called with one argument, the instance of WP_Customize_Partial. 106 * The callback can either echo the partial or return the partial as a string, 107 * or return false if error. 108 * @type bool $container_inclusive Whether the container element is included in the partial, or if only 109 * the contents are rendered. 110 * @type bool $fallback_refresh Whether to refresh the entire preview in case a partial cannot be refreshed. 111 * A partial render is considered a failure if the render_callback returns 112 * false. 113 * } 95 114 * @return WP_Customize_Partial The instance of the panel that was added. 96 115 */
Note: See TracChangeset
for help on using the changeset viewer.