Changeset 36698 for trunk/src/wp-includes/class-wp-customize-manager.php
- Timestamp:
- 02/24/2016 10:09:54 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-customize-manager.php
r36687 r36698 218 218 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-cropped-image-control.php' ); 219 219 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-site-icon-control.php' ); 220 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-site-logo-control.php' ); 220 221 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-control.php' ); 221 222 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-theme-control.php' ); … … 829 830 'activeControls' => array(), 830 831 'nonce' => $this->get_nonces(), 832 'l10n' => array( 833 'shiftClickToEdit' => __( 'Shift-click to edit this element.' ), 834 ), 831 835 '_dirty' => array_keys( $this->unsanitized_post_values() ), 832 836 ); … … 1858 1862 $this->register_control_type( 'WP_Customize_Cropped_Image_Control' ); 1859 1863 $this->register_control_type( 'WP_Customize_Site_Icon_Control' ); 1864 $this->register_control_type( 'WP_Customize_Site_Logo_Control' ); 1860 1865 $this->register_control_type( 'WP_Customize_Theme_Control' ); 1861 1866 … … 1932 1937 'section' => 'title_tagline', 1933 1938 ) ); 1939 1940 // Add a setting to hide header text if the theme isn't supporting the feature itself. 1941 // @todo 1942 if ( ! current_theme_supports( 'custom-header' ) ) { 1943 $this->add_setting( 'header_text', array( 1944 'default' => 1, 1945 'sanitize_callback' => 'absint', 1946 'transport' => 'postMessage', 1947 ) ); 1948 1949 $this->add_control( 'header_text', array( 1950 'label' => __( 'Display Site Title and Tagline' ), 1951 'section' => 'title_tagline', 1952 'settings' => 'header_text', 1953 'type' => 'checkbox', 1954 ) ); 1955 } 1934 1956 1935 1957 $this->add_setting( 'site_icon', array( … … 1952 1974 ) ) ); 1953 1975 1976 $this->add_setting( 'site_logo', array( 1977 'theme_supports' => array( 'site-logo' ), 1978 'transport' => 'postMessage', 1979 ) ); 1980 1981 $this->add_control( new WP_Customize_Site_Logo_Control( $this, 'site_logo', array( 1982 'label' => __( 'Logo' ), 1983 'section' => 'title_tagline', 1984 'priority' => 0, 1985 ) ) ); 1986 1987 if ( isset( $this->selective_refresh ) ) { 1988 $this->selective_refresh->add_partial( 'site_logo', array( 1989 'settings' => array( 'site_logo' ), 1990 'selector' => '.site-logo-link', 1991 'render_callback' => array( $this, '_render_site_logo_partial' ), 1992 'container_inclusive' => true, 1993 ) ); 1994 } 1995 1954 1996 /* Colors */ 1955 1997 … … 2180 2222 2181 2223 return $color; 2224 } 2225 2226 /** 2227 * Callback for rendering the site logo, used in the site_logo partial. 2228 * 2229 * This method exists because the partial object and context data are passed 2230 * into a partial's render_callback so we cannot use get_the_site_logo() as 2231 * the render_callback directly since it expects a blog ID as the first 2232 * argument. When WP no longer supports PHP 5.3, this method can be removed 2233 * in favor of an anonymous function. 2234 * 2235 * @see WP_Customize_Manager::register_controls() 2236 * 2237 * @since 4.5.0 2238 * @access private 2239 * 2240 * @return string Site logo. 2241 */ 2242 public function _render_site_logo_partial() { 2243 return get_the_site_logo(); 2182 2244 } 2183 2245 }
Note: See TracChangeset
for help on using the changeset viewer.