Make WordPress Core


Ignore:
Timestamp:
07/10/2015 09:32:23 PM (11 years ago)
Author:
obenland
Message:

Site Icon: Add Customizer UI.

Second part of the Site Icon feature after [32994] introduced it for Settings.

Props celloexpressions.
See #16434.

File:
1 edited

Legend:

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

    r32964 r33154  
    12791279                $this->register_control_type( 'WP_Customize_Image_Control' );
    12801280                $this->register_control_type( 'WP_Customize_Background_Image_Control' );
     1281                $this->register_control_type( 'WP_Customize_Cropped_Image_Control' );
     1282                $this->register_control_type( 'WP_Customize_Site_Icon_Control' );
    12811283                $this->register_control_type( 'WP_Customize_Theme_Control' );
    12821284
    … …  
    13251327                }
    13261328
    1327                 /* Site Title & Tagline */
     1329                /* Site Identity */
    13281330
    13291331                $this->add_section( 'title_tagline', array(
    1330                         'title'    => __( 'Site Title & Tagline' ),
     1332                        'title'    => __( 'Site Identity' ),
    13311333                        'priority' => 20,
    13321334                ) );
    … …  
    13531355                        'section'    => 'title_tagline',
    13541356                ) );
     1357
     1358                $icon = wp_get_attachment_image_src( absint( get_option( 'site_icon' ) ), 'full' );
     1359                $this->add_setting( 'site_icon', array(
     1360                        'default'    => $icon[0] ? $icon[0] : '',
     1361                        'type'       => 'option',
     1362                        'capability' => 'manage_options',
     1363                        'transport'  => 'postMessage', // Previewed with JS in the Customizer controls window.
     1364                ) );
     1365
     1366                $this->add_control( new WP_Customize_Site_Icon_Control( $this, 'site_icon', array(
     1367                        'label'       => __( 'Site Icon' ),
     1368                        'description' => __( 'The Site Icon is used as a browser and app icon for your site. Icons must be square, and at least 512px wide and tall.' ),
     1369                        'section'     => 'title_tagline',
     1370                        'priority'    => 60,
     1371                        'height'      => 512,
     1372                        'width'       => 512,
     1373                ) ) );
    13551374
    13561375                /* Colors */
    … …  
    13761395                        'section'  => 'title_tagline',
    13771396                        'type'     => 'checkbox',
     1397                        'priority' => 40,
    13781398                ) );
    13791399
Note: See TracChangeset for help on using the changeset viewer.