Changeset 47122 for trunk/src/wp-includes/class-wp-customize-manager.php
- Timestamp:
- 01/29/2020 12:43:23 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-customize-manager.php
r46821 r47122 271 271 } 272 272 273 // The theme and messenger_channel should be supplied via $args, but they are also looked at in the $_REQUEST global here for back-compat. 273 // The theme and messenger_channel should be supplied via $args, 274 // but they are also looked at in the $_REQUEST global here for back-compat. 274 275 if ( ! isset( $args['theme'] ) ) { 275 276 if ( isset( $_REQUEST['customize_theme'] ) ) { … … 384 385 385 386 add_action( 'customize_register', array( $this, 'register_controls' ) ); 386 add_action( 'customize_register', array( $this, 'register_dynamic_settings' ), 11 ); // allow code to create settings first387 add_action( 'customize_register', array( $this, 'register_dynamic_settings' ), 11 ); // Allow code to create settings first. 387 388 add_action( 'customize_controls_init', array( $this, 'prepare_controls' ) ); 388 389 add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ) ); … … 505 506 global $pagenow; 506 507 507 // Check permissions for customize.php access since this method is called before customize.php can run any code ,508 // Check permissions for customize.php access since this method is called before customize.php can run any code. 508 509 if ( 'customize.php' === $pagenow && ! current_user_can( 'customize' ) ) { 509 510 if ( ! is_user_logged_in() ) { … … 564 565 add_action( 'after_setup_theme', array( $this, 'after_setup_theme' ) ); 565 566 } else { 566 // If the requested theme is not the active theme and the user doesn't have the567 // switch_themes cap, bail.567 // If the requested theme is not the active theme and the user doesn't have 568 // the switch_themes cap, bail. 568 569 if ( ! current_user_can( 'switch_themes' ) ) { 569 570 $this->wp_die( -1, __( 'Sorry, you are not allowed to edit theme options on this site.' ) ); … … 899 900 public function wp_loaded() { 900 901 901 // Unconditionally register core types for panels, sections, and controls in case plugin unhooks all customize_register actions. 902 // Unconditionally register core types for panels, sections, and controls 903 // in case plugin unhooks all customize_register actions. 902 904 $this->register_panel_type( 'WP_Customize_Panel' ); 903 905 $this->register_panel_type( 'WP_Customize_Themes_Panel' ); … … 2942 2944 // See _wp_translate_postdata() for why this is required as it will use the edit_post meta capability. 2943 2945 add_filter( 'map_meta_cap', array( $this, 'grant_edit_post_capability_for_changeset' ), 10, 4 ); 2946 2944 2947 $post_array['post_ID'] = $post_array['ID']; 2945 2948 $post_array['post_type'] = 'customize_changeset'; 2946 $r = wp_create_post_autosave( wp_slash( $post_array ) ); 2949 2950 $r = wp_create_post_autosave( wp_slash( $post_array ) ); 2951 2947 2952 remove_filter( 'map_meta_cap', array( $this, 'grant_edit_post_capability_for_changeset' ), 10 ); 2948 2953 } else { 2949 2954 $post_array['edit_date'] = true; // Prevent date clearing. 2950 $r = wp_update_post( wp_slash( $post_array ), true ); 2955 2956 $r = wp_update_post( wp_slash( $post_array ), true ); 2951 2957 2952 2958 // Delete autosave revision for user when the changeset is updated. … … 3733 3739 $new_settings = array(); 3734 3740 foreach ( $setting_ids as $setting_id ) { 3735 // Skip settings already created 3741 // Skip settings already created. 3736 3742 if ( $this->get_setting( $setting_id ) ) { 3737 3743 continue; … … 5203 5209 ); 5204 5210 5205 // Input type: checkbox 5206 // With custom value 5211 // Input type: checkbox. 5212 // With custom value. 5207 5213 $this->add_control( 5208 5214 'display_header_text', … … 5227 5233 ); 5228 5234 5229 // Input type: Color5230 // With sanitize_callback 5235 // Input type: color. 5236 // With sanitize_callback. 5231 5237 $this->add_setting( 5232 5238 'background_color',
Note: See TracChangeset
for help on using the changeset viewer.