Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve inline comments per the documentation standards.

Includes minor code layout fixes for better readability.

See #48303.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r46821 r47122  
    271271        }
    272272
    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.
    274275        if ( ! isset( $args['theme'] ) ) {
    275276            if ( isset( $_REQUEST['customize_theme'] ) ) {
     
    384385
    385386        add_action( 'customize_register', array( $this, 'register_controls' ) );
    386         add_action( 'customize_register', array( $this, 'register_dynamic_settings' ), 11 ); // allow code to create settings first
     387        add_action( 'customize_register', array( $this, 'register_dynamic_settings' ), 11 ); // Allow code to create settings first.
    387388        add_action( 'customize_controls_init', array( $this, 'prepare_controls' ) );
    388389        add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ) );
     
    505506        global $pagenow;
    506507
    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.
    508509        if ( 'customize.php' === $pagenow && ! current_user_can( 'customize' ) ) {
    509510            if ( ! is_user_logged_in() ) {
     
    564565            add_action( 'after_setup_theme', array( $this, 'after_setup_theme' ) );
    565566        } else {
    566             // If the requested theme is not the active theme and the user doesn't have the
    567             // 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.
    568569            if ( ! current_user_can( 'switch_themes' ) ) {
    569570                $this->wp_die( -1, __( 'Sorry, you are not allowed to edit theme options on this site.' ) );
     
    899900    public function wp_loaded() {
    900901
    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.
    902904        $this->register_panel_type( 'WP_Customize_Panel' );
    903905        $this->register_panel_type( 'WP_Customize_Themes_Panel' );
     
    29422944                // See _wp_translate_postdata() for why this is required as it will use the edit_post meta capability.
    29432945                add_filter( 'map_meta_cap', array( $this, 'grant_edit_post_capability_for_changeset' ), 10, 4 );
     2946
    29442947                $post_array['post_ID']   = $post_array['ID'];
    29452948                $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
    29472952                remove_filter( 'map_meta_cap', array( $this, 'grant_edit_post_capability_for_changeset' ), 10 );
    29482953            } else {
    29492954                $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 );
    29512957
    29522958                // Delete autosave revision for user when the changeset is updated.
     
    37333739        $new_settings = array();
    37343740        foreach ( $setting_ids as $setting_id ) {
    3735             // Skip settings already created
     3741            // Skip settings already created.
    37363742            if ( $this->get_setting( $setting_id ) ) {
    37373743                continue;
     
    52035209        );
    52045210
    5205         // Input type: checkbox
    5206         // With custom value
     5211        // Input type: checkbox.
     5212        // With custom value.
    52075213        $this->add_control(
    52085214            'display_header_text',
     
    52275233        );
    52285234
    5229         // Input type: Color
    5230         // With sanitize_callback
     5235        // Input type: color.
     5236        // With sanitize_callback.
    52315237        $this->add_setting(
    52325238            'background_color',
Note: See TracChangeset for help on using the changeset viewer.