<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[36698] trunk/src: Customize: Introduce Logo support for themes.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/36698">36698</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/36698","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>obenland</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2016-02-24 22:09:54 +0000 (Wed, 24 Feb 2016)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Customize: Introduce Logo support for themes.
Allows a common theme feature to have a common implementation provided by core and available in a consistent location for users.
See https://make.wordpress.org/core/2016/02/24/theme-logo-support/
Props kwight, enejb, jeherve, bhubbard, samhotchkiss, zinigor, eliorivero, adamsilverstein, melchoyce, ryan, mikeschroder, westonruter, pento, karmatosed, celloexpressions, obenland.
See <a href="https://core.trac.wordpress.org/ticket/33755">#33755</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadmincsscustomizecontrolscss">trunk/src/wp-admin/css/customize-controls.css</a></li>
<li><a href="#trunksrcwpadminincludesadminphp">trunk/src/wp-admin/includes/admin.php</a></li>
<li><a href="#trunksrcwpadminincludestemplatephp">trunk/src/wp-admin/includes/template.php</a></li>
<li><a href="#trunksrcwpadminjscustomizecontrolsjs">trunk/src/wp-admin/js/customize-controls.js</a></li>
<li><a href="#trunksrcwpincludesclasswpcustomizemanagerphp">trunk/src/wp-includes/class-wp-customize-manager.php</a></li>
<li><a href="#trunksrcwpincludescustomizeclasswpcustomizesiteiconcontrolphp">trunk/src/wp-includes/customize/class-wp-customize-site-icon-control.php</a></li>
<li><a href="#trunksrcwpincludesgeneraltemplatephp">trunk/src/wp-includes/general-template.php</a></li>
<li><a href="#trunksrcwpincludesjscustomizepreviewjs">trunk/src/wp-includes/js/customize-preview.js</a></li>
<li><a href="#trunksrcwpincludesposttemplatephp">trunk/src/wp-includes/post-template.php</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesclasswpsitelogophp">trunk/src/wp-admin/includes/class-wp-site-logo.php</a></li>
<li><a href="#trunksrcwpincludescustomizeclasswpcustomizesitelogocontrolphp">trunk/src/wp-includes/customize/class-wp-customize-site-logo-control.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadmincsscustomizecontrolscss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/css/customize-controls.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/css/customize-controls.css 2016-02-24 21:48:02 UTC (rev 36697)
+++ trunk/src/wp-admin/css/customize-controls.css 2016-02-24 22:09:54 UTC (rev 36698)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -725,6 +725,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-background .current,
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-cropped_image .current,
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-site_icon .current,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.customize-control-site_logo .current,
</ins><span class="cx" style="display: block; padding: 0 10px"> .customize-control-header .current {
</span><span class="cx" style="display: block; padding: 0 10px"> margin-bottom: 8px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -766,6 +767,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-site_icon .remove-button,
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-site_icon .default-button,
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-site_icon .upload-button,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.customize-control-site_logo .remove-button,
+.customize-control-site_logo .default-button,
+.customize-control-site_logo .upload-button,
</ins><span class="cx" style="display: block; padding: 0 10px"> .customize-control-header button.new,
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-header button.remove {
</span><span class="cx" style="display: block; padding: 0 10px"> white-space: normal;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -779,6 +783,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-background .current .container,
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-cropped_image .current .container,
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-site_icon .current .container,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.customize-control-site_logo .current .container,
</ins><span class="cx" style="display: block; padding: 0 10px"> .customize-control-header .current .container {
</span><span class="cx" style="display: block; padding: 0 10px"> overflow: hidden;
</span><span class="cx" style="display: block; padding: 0 10px"> -webkit-border-radius: 2px;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -792,6 +797,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-background .current .container,
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-cropped_image .current .container,
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-site_icon .current .container,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.customize-control-site_logo .current .container,
</ins><span class="cx" style="display: block; padding: 0 10px"> .customize-control-image .current .container {
</span><span class="cx" style="display: block; padding: 0 10px"> min-height: 40px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -820,6 +826,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-background .inner,
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-cropped_image .inner,
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-site_icon .inner,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.customize-control-site_logo .inner,
</ins><span class="cx" style="display: block; padding: 0 10px"> .customize-control-header .inner {
</span><span class="cx" style="display: block; padding: 0 10px"> display: none;
</span><span class="cx" style="display: block; padding: 0 10px"> position: absolute;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -835,6 +842,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-background .inner,
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-cropped_image .inner,
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-site_icon .inner,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.customize-control-site_logo .inner,
</ins><span class="cx" style="display: block; padding: 0 10px"> .customize-control-image .inner {
</span><span class="cx" style="display: block; padding: 0 10px"> display: block;
</span><span class="cx" style="display: block; padding: 0 10px"> min-height: 40px;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -846,6 +854,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-background .inner,
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-cropped_image .inner,
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-site_icon .inner,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.customize-control-site_logo.inner,
</ins><span class="cx" style="display: block; padding: 0 10px"> .customize-control-header .inner,
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-header .inner .dashicons {
</span><span class="cx" style="display: block; padding: 0 10px"> line-height: 20px;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -989,6 +998,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-cropped_image .default-button,
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-site_icon .remove-button,
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-site_icon .default-button,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.customize-control-site_logo .remove-button,
+.customize-control-site_logo .default-button,
</ins><span class="cx" style="display: block; padding: 0 10px"> .customize-control-header .remove {
</span><span class="cx" style="display: block; padding: 0 10px"> float: left;
</span><span class="cx" style="display: block; padding: 0 10px"> margin-right: 3px;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1000,6 +1011,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-background .upload-button,
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-cropped_image .upload-button,
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control-site_icon .upload-button,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.customize-control-site_logo .upload-button,
</ins><span class="cx" style="display: block; padding: 0 10px"> .customize-control-header .new {
</span><span class="cx" style="display: block; padding: 0 10px"> float: right;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludesadminphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/admin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/admin.php 2016-02-24 21:48:02 UTC (rev 36697)
+++ trunk/src/wp-admin/includes/admin.php 2016-02-24 22:09:54 UTC (rev 36698)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,6 +72,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** WordPress Site Icon API */
</span><span class="cx" style="display: block; padding: 0 10px"> require_once(ABSPATH . 'wp-admin/includes/class-wp-site-icon.php');
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** WordPress Site Logo API */
+require_once(ABSPATH . 'wp-admin/includes/class-wp-site-logo.php');
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /** WordPress Update Administration API */
</span><span class="cx" style="display: block; padding: 0 10px"> require_once(ABSPATH . 'wp-admin/includes/update.php');
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpsitelogophp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-admin/includes/class-wp-site-logo.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-site-logo.php (rev 0)
+++ trunk/src/wp-admin/includes/class-wp-site-logo.php 2016-02-24 22:09:54 UTC (rev 36698)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,136 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Administration API: WP_Site_Logo class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.5.0
+ */
+
+/**
+ * Core class used to implement site logo functionality.
+ *
+ * @since 4.5.0
+ */
+class WP_Site_Logo {
+
+ /**
+ * Get current logo settings stored in theme mod.
+ *
+ * @since 4.5.0
+ * @access public
+ */
+ public function __construct() {
+ add_action( 'wp_head', array( $this, 'head_text_styles' ) );
+ add_action( 'delete_attachment', array( $this, 'delete_attachment_data' ) );
+ add_filter( 'image_size_names_choose', array( $this, 'media_manager_image_sizes' ) );
+ }
+
+ /**
+ * Hide header text on front-end if necessary.
+ *
+ * @since 4.5.0
+ * @access public
+ */
+ public function head_text_styles() {
+ // Bail if our theme supports custom headers.
+ if ( current_theme_supports( 'custom-header' ) || get_theme_mod( 'site_logo_header_text', true ) ) {
+ return;
+ }
+
+ // Is Display Header Text unchecked? If so, we need to hide our header text.
+ ?>
+ <!-- Site Logo: hide header text -->
+ <style type="text/css">
+ <?php echo sanitize_html_class( $this->header_text_classes() ); ?> {
+ position: absolute;
+ clip: rect(1px, 1px, 1px, 1px);
+ }
+ </style>
+ <?php
+ }
+
+ /**
+ * Reset the site logo if the current logo is deleted in the media manager.
+ *
+ * @since 4.5.0
+ * @access public
+ *
+ * @param int $post_id
+ */
+ public function delete_attachment_data( $post_id ) {
+ $site_logo_id = get_theme_mod( 'site_logo' );
+
+ if ( $site_logo_id && $site_logo_id == $post_id ) {
+ remove_theme_mod( 'site_logo' );
+ }
+ }
+
+ /**
+ * Make custom image sizes available to the media manager.
+ *
+ * @since 4.5.0
+ * @access public
+ *
+ * @param array $sizes Image sizes.
+ * @return array All default and registered custom image sizes.
+ */
+ public function media_manager_image_sizes( $sizes ) {
+
+ // Get an array of all registered image sizes.
+ $intermediate = get_intermediate_image_sizes();
+
+ // Have we got anything fun to work with?
+ if ( is_array( $intermediate ) && ! empty( $intermediate ) ) {
+ foreach ( $intermediate as $key => $size ) {
+
+ // If the size isn't already in the $sizes array, add it.
+ if ( ! array_key_exists( $size, $sizes ) ) {
+ $sizes[ $size ] = $size;
+ }
+ }
+ }
+
+ return $sizes;
+ }
+
+ /**
+ * Get header text classes. If not defined in add_theme_support(), defaults from Underscores will be used.
+ *
+ * @since 4.5.0
+ * @access protected
+ *
+ * @return string String of classes to hide
+ */
+ protected function header_text_classes() {
+ $args = get_theme_support( 'site-logo' );
+
+ if ( isset( $args[0]['header-text'] ) ) {
+ // Use any classes defined in add_theme_support().
+ $classes = $args[0]['header-text'];
+ } else {
+ // Otherwise, use these defaults, which will work with any Underscores-based theme.
+ $classes = array(
+ 'site-title',
+ 'site-description',
+ );
+ }
+
+ // If we've got an array, reduce them to a string for output.
+ if ( is_array( $classes ) ) {
+ $classes = array_map( 'sanitize_html_class', $classes );
+ $classes = (string) '.' . implode( ', .', $classes );
+ } else {
+ $classes = (string) '.' . $classes;
+ }
+
+ return $classes;
+ }
+}
+
+/**
+ * WP_Site_Logo instance.
+ *
+ * @global WP_Site_Logo $wp_site_logo
+ */
+$GLOBALS['wp_site_logo'] = new WP_Site_Logo;
</ins></span></pre></div>
<a id="trunksrcwpadminincludestemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/template.php 2016-02-24 21:48:02 UTC (rev 36697)
+++ trunk/src/wp-admin/includes/template.php 2016-02-24 22:09:54 UTC (rev 36698)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1750,13 +1750,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $media_states[] = __( 'Site Icon' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $post->ID == get_theme_mod( 'site_logo' ) ) {
+ $media_states[] = __( 'Logo' );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filter the default media display states for items in the Media list table.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $media_states An array of media states. Default 'Header Image',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * 'Background Image', 'Site Icon'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * 'Background Image', 'Site Icon', 'Logo'.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $media_states = apply_filters( 'display_media_states', $media_states );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminjscustomizecontrolsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/customize-controls.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/customize-controls.js 2016-02-24 21:48:02 UTC (rev 36697)
+++ trunk/src/wp-admin/js/customize-controls.js 2016-02-24 22:09:54 UTC (rev 36698)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2303,10 +2303,47 @@
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * A control for selecting Site Logos.
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @class
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @augments wp.customize.MediaControl
</ins><span class="cx" style="display: block; padding: 0 10px"> * @augments wp.customize.Control
</span><span class="cx" style="display: block; padding: 0 10px"> * @augments wp.customize.Class
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ api.SiteLogoControl = api.MediaControl.extend({
+
+ /**
+ * When the control's DOM structure is ready,
+ * set up internal event bindings.
+ */
+ ready: function() {
+ var control = this;
+
+ // Shortcut so that we don't have to use _.bind every time we add a callback.
+ _.bindAll( control, 'restoreDefault', 'removeFile', 'openFrame', 'select' );
+
+ // Bind events, with delegation to facilitate re-rendering.
+ control.container.on( 'click keydown', '.upload-button', control.openFrame );
+ control.container.on( 'click keydown', '.thumbnail-image img', control.openFrame );
+ control.container.on( 'click keydown', '.default-button', control.restoreDefault );
+ control.container.on( 'click keydown', '.remove-button', control.removeFile );
+
+ control.setting.bind( function( attachmentId ) {
+ wp.media.attachment( attachmentId ).fetch().done( function() {
+ wp.customize.previewer.send( 'site-logo-attachment-data', this.attributes );
+ } );
+
+ // Re-render whenever the control's setting changes.
+ control.renderContent();
+ } );
+ }
+ });
+
+ /**
+ * @class
+ * @augments wp.customize.Control
+ * @augments wp.customize.Class
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> api.HeaderControl = api.Control.extend({
</span><span class="cx" style="display: block; padding: 0 10px"> ready: function() {
</span><span class="cx" style="display: block; padding: 0 10px"> this.btnRemove = $('#customize-control-header_image .actions .remove');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3208,6 +3245,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> image: api.ImageControl,
</span><span class="cx" style="display: block; padding: 0 10px"> cropped_image: api.CroppedImageControl,
</span><span class="cx" style="display: block; padding: 0 10px"> site_icon: api.SiteIconControl,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ site_logo: api.SiteLogoControl,
</ins><span class="cx" style="display: block; padding: 0 10px"> header: api.HeaderControl,
</span><span class="cx" style="display: block; padding: 0 10px"> background: api.BackgroundControl,
</span><span class="cx" style="display: block; padding: 0 10px"> theme: api.ThemeControl
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpcustomizemanagerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-customize-manager.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-customize-manager.php 2016-02-24 21:48:02 UTC (rev 36697)
+++ trunk/src/wp-includes/class-wp-customize-manager.php 2016-02-24 22:09:54 UTC (rev 36698)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -217,6 +217,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . WPINC . '/customize/class-wp-customize-background-image-control.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . WPINC . '/customize/class-wp-customize-cropped-image-control.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . WPINC . '/customize/class-wp-customize-site-icon-control.php' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ require_once( ABSPATH . WPINC . '/customize/class-wp-customize-site-logo-control.php' );
</ins><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-control.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . WPINC . '/customize/class-wp-customize-theme-control.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . WPINC . '/customize/class-wp-widget-area-customize-control.php' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -828,6 +829,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'activeSections' => array(),
</span><span class="cx" style="display: block; padding: 0 10px"> 'activeControls' => array(),
</span><span class="cx" style="display: block; padding: 0 10px"> 'nonce' => $this->get_nonces(),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'l10n' => array(
+ 'shiftClickToEdit' => __( 'Shift-click to edit this element.' ),
+ ),
</ins><span class="cx" style="display: block; padding: 0 10px"> '_dirty' => array_keys( $this->unsanitized_post_values() ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1857,6 +1861,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->register_control_type( 'WP_Customize_Background_Image_Control' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->register_control_type( 'WP_Customize_Cropped_Image_Control' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->register_control_type( 'WP_Customize_Site_Icon_Control' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->register_control_type( 'WP_Customize_Site_Logo_Control' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->register_control_type( 'WP_Customize_Theme_Control' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Themes */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1932,6 +1937,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'section' => 'title_tagline',
</span><span class="cx" style="display: block; padding: 0 10px"> ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Add a setting to hide header text if the theme isn't supporting the feature itself.
+ // @todo
+ if ( ! current_theme_supports( 'custom-header' ) ) {
+ $this->add_setting( 'header_text', array(
+ 'default' => 1,
+ 'sanitize_callback' => 'absint',
+ 'transport' => 'postMessage',
+ ) );
+
+ $this->add_control( 'header_text', array(
+ 'label' => __( 'Display Site Title and Tagline' ),
+ 'section' => 'title_tagline',
+ 'settings' => 'header_text',
+ 'type' => 'checkbox',
+ ) );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->add_setting( 'site_icon', array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'option',
</span><span class="cx" style="display: block; padding: 0 10px"> 'capability' => 'manage_options',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1951,6 +1973,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'width' => 512,
</span><span class="cx" style="display: block; padding: 0 10px"> ) ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->add_setting( 'site_logo', array(
+ 'theme_supports' => array( 'site-logo' ),
+ 'transport' => 'postMessage',
+ ) );
+
+ $this->add_control( new WP_Customize_Site_Logo_Control( $this, 'site_logo', array(
+ 'label' => __( 'Logo' ),
+ 'section' => 'title_tagline',
+ 'priority' => 0,
+ ) ) );
+
+ if ( isset( $this->selective_refresh ) ) {
+ $this->selective_refresh->add_partial( 'site_logo', array(
+ 'settings' => array( 'site_logo' ),
+ 'selector' => '.site-logo-link',
+ 'render_callback' => array( $this, '_render_site_logo_partial' ),
+ 'container_inclusive' => true,
+ ) );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Colors */
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->add_section( 'colors', array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2180,6 +2222,26 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $color;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /**
+ * Callback for rendering the site logo, used in the site_logo partial.
+ *
+ * This method exists because the partial object and context data are passed
+ * into a partial's render_callback so we cannot use get_the_site_logo() as
+ * the render_callback directly since it expects a blog ID as the first
+ * argument. When WP no longer supports PHP 5.3, this method can be removed
+ * in favor of an anonymous function.
+ *
+ * @see WP_Customize_Manager::register_controls()
+ *
+ * @since 4.5.0
+ * @access private
+ *
+ * @return string Site logo.
+ */
+ public function _render_site_logo_partial() {
+ return get_the_site_logo();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpincludescustomizeclasswpcustomizesiteiconcontrolphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/customize/class-wp-customize-site-icon-control.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/customize/class-wp-customize-site-icon-control.php 2016-02-24 21:48:02 UTC (rev 36697)
+++ trunk/src/wp-includes/customize/class-wp-customize-site-icon-control.php 2016-02-24 22:09:54 UTC (rev 36698)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,4 +41,71 @@
</span><span class="cx" style="display: block; padding: 0 10px"> parent::__construct( $manager, $id, $args );
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'customize_controls_print_styles', 'wp_site_icon', 99 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /**
+ * Render a JS template for the content of the site icon control.
+ *
+ * @since 4.5.0
+ */
+ public function content_template() {
+ ?>
+ <label for="{{ data.settings['default'] }}-button">
+ <# if ( data.label ) { #>
+ <span class="customize-control-title">{{ data.label }}</span>
+ <# } #>
+ <# if ( data.description ) { #>
+ <span class="description customize-control-description">{{{ data.description }}}</span>
+ <# } #>
+ </label>
+
+ <# if ( data.attachment && data.attachment.id ) { #>
+ <div class="current">
+ <div class="container">
+ <div class="attachment-media-view attachment-media-view-{{ data.attachment.type }} {{ data.attachment.orientation }} site-icon-preview">
+ <strong><?php _e( 'As a browser icon' ); ?></strong>
+ <div class="favicon-preview">
+ <img src="images/browser.png" class="browser-preview" width="182" height="" alt="" />
+
+ <div class="favicon">
+ <img id="preview-favicon" src="{{ data.attachment.sizes.full.url }}" alt="<?php esc_attr_e( 'Preview as a browser icon' ); ?>"/>
+ </div>
+ <span class="browser-title"><?php bloginfo( 'name' ); ?></span>
+ </div>
+
+ <strong><?php _e( 'As an app icon' ); ?></strong>
+ <p class="app-icon-preview">
+ <img id="preview-app-icon" src="{{ data.attachment.sizes.full.url }}" alt="<?php esc_attr_e( 'Preview as an app icon' ); ?>"/>
+ </p>
+ </div>
+ </div>
+ </div>
+ <div class="actions">
+ <# if ( data.canUpload ) { #>
+ <button type="button" class="button remove-button"><?php echo $this->button_labels['remove']; ?></button>
+ <button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button"><?php echo $this->button_labels['change']; ?></button>
+ <div style="clear:both"></div>
+ <# } #>
+ </div>
+ <# } else { #>
+ <div class="current">
+ <div class="container">
+ <div class="placeholder">
+ <div class="inner">
+ <span><?php echo $this->button_labels['placeholder']; ?></span>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="actions">
+ <# if ( data.defaultAttachment ) { #>
+ <button type="button" class="button default-button"><?php echo $this->button_labels['default']; ?></button>
+ <# } #>
+ <# if ( data.canUpload ) { #>
+ <button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button"><?php echo $this->button_labels['select']; ?></button>
+ <# } #>
+ <div style="clear:both"></div>
+ </div>
+ <# } #>
+ <?php
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludescustomizeclasswpcustomizesitelogocontrolphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-includes/customize/class-wp-customize-site-logo-control.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/customize/class-wp-customize-site-logo-control.php (rev 0)
+++ trunk/src/wp-includes/customize/class-wp-customize-site-logo-control.php 2016-02-24 22:09:54 UTC (rev 36698)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,53 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Customize API: WP_Customize_Site_Logo_Control class
+ *
+ * @package WordPress
+ * @subpackage Customize
+ * @since 4.5.0
+ */
+
+/**
+ * Customize Site Logo control class.
+ *
+ * Used only for custom functionality in JavaScript.
+ *
+ * @since 4.5.0
+ *
+ * @see WP_Customize_Image_Control
+ */
+class WP_Customize_Site_Logo_Control extends WP_Customize_Image_Control {
+
+ /**
+ * Control type.
+ *
+ * @since 4.5.0
+ * @access public
+ * @var string
+ */
+ public $type = 'site_logo';
+
+ /**
+ * Constructor.
+ *
+ * @since 4.5.0
+ * @access public
+ *
+ * @param WP_Customize_Manager $manager Customizer bootstrap instance.
+ * @param string $id Control ID.
+ * @param array $args Optional. Arguments to override class property defaults.
+ */
+ public function __construct( $manager, $id, $args = array() ) {
+ parent::__construct( $manager, $id, $args );
+
+ $this->button_labels = array(
+ 'select' => __( 'Select logo' ),
+ 'change' => __( 'Change logo' ),
+ 'remove' => __( 'Remove' ),
+ 'default' => __( 'Default' ),
+ 'placeholder' => __( 'No logo selected' ),
+ 'frame_title' => __( 'Select logo' ),
+ 'frame_button' => __( 'Choose logo' ),
+ );
+ }
+}
</ins></span></pre></div>
<a id="trunksrcwpincludesgeneraltemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/general-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/general-template.php 2016-02-24 21:48:02 UTC (rev 36697)
+++ trunk/src/wp-includes/general-template.php 2016-02-24 22:09:54 UTC (rev 36698)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -832,6 +832,93 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Whether the site has a Site Logo.
+ *
+ * @since 4.5.0
+ *
+ * @param int $blog_id Optional. ID of the blog in question. Default current blog.
+ * @return bool Whether the site has a site logo or not.
+ */
+function has_site_logo( $blog_id = 0 ) {
+ if ( is_multisite() && (int) $blog_id !== get_current_blog_id() ) {
+ switch_to_blog( $blog_id );
+ }
+
+ $site_logo_id = get_theme_mod( 'site_logo' );
+
+ if ( is_multisite() && ms_is_switched() ) {
+ restore_current_blog();
+ }
+
+ return (bool) $site_logo_id;
+}
+
+/**
+ * Returns a Site Logo, linked to home.
+ *
+ * @since 4.5.0
+ *
+ * @param int $blog_id Optional. ID of the blog in question. Default current blog.
+ * @return string Site logo markup.
+ */
+function get_the_site_logo( $blog_id = 0 ) {
+ $html = '';
+
+ if ( is_multisite() && (int) $blog_id !== get_current_blog_id() ) {
+ switch_to_blog( $blog_id );
+ }
+
+ $site_logo_id = get_theme_mod( 'site_logo' );
+
+ if ( is_multisite() && ms_is_switched() ) {
+ restore_current_blog();
+ }
+ $size = get_theme_support( 'site-logo' );
+ $size = $size[0]['size'];
+
+ // We have a logo. Logo is go.
+ if ( $site_logo_id ) {
+ $html = sprintf( '<a href="%1$s" class="site-logo-link" rel="home" itemprop="url">%2$s</a>',
+ esc_url( home_url( '/' ) ),
+ wp_get_attachment_image( $site_logo_id, $size, false, array(
+ 'class' => "site-logo attachment-$size",
+ 'data-size' => $size,
+ 'itemprop' => 'logo',
+ ) )
+ );
+ }
+
+ // If no logo is set but we're in the Customizer, leave a placeholder (needed for the live preview).
+ elseif ( is_customize_preview() ) {
+ $html = sprintf( '<a href="%1$s" class="site-logo-link" style="display:none;"><img class="site-logo" data-size="%2$s" /></a>',
+ esc_url( home_url( '/' ) ),
+ esc_attr( $size )
+ );
+ }
+
+ /**
+ * Filter the Site Logo output.
+ *
+ * @since 4.5.0
+ *
+ * @param string $html Site Logo HTML output.
+ * @param string $size Size specified in add_theme_support declaration, or 'thumbnail' default.
+ */
+ return apply_filters( 'get_the_site_logo', $html, $size );
+}
+
+/**
+ * Displays a Site Logo, linked to home.
+ *
+ * @since 4.5.0
+ *
+ * @param int $blog_id Optional. ID of the blog in question. Default current blog.
+ */
+function the_site_logo( $blog_id = 0 ) {
+ echo get_the_site_logo( $blog_id );
+}
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Returns document title for the current page.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.4.0
</span></span></pre></div>
<a id="trunksrcwpincludesjscustomizepreviewjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/customize-preview.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/customize-preview.js 2016-02-24 21:48:02 UTC (rev 36697)
+++ trunk/src/wp-includes/js/customize-preview.js 2016-02-24 22:09:54 UTC (rev 36698)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -223,6 +223,62 @@
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Site Logo
+ *
+ * The site logo setting only contains the attachment ID. To avoid having to send an AJAX request to get more
+ * data, we send a separate message with the attachment data we get from the Customizer's media modal.
+ * Therefore first callback handles only the event of a new logo being selected.
+ *
+ * We don't need any information about a removed logo, so the second callback only handles that.
+ *
+ * @since 4.5.0
+ */
+ api.preview.bind( 'site-logo-attachment-data', function( attachment ) {
+ var $logo = $( '.site-logo' ),
+ size = $logo.data( 'size' ),
+ srcset = [];
+
+ // If the source was smaller than the size required by the theme, give the biggest we've got.
+ if ( ! attachment.sizes[ size ] ) {
+ size = 'full';
+ }
+
+ _.each( attachment.sizes, function( size ) {
+ srcset.push( size.url + ' ' + size.width + 'w' );
+ } );
+
+ $logo.attr( {
+ height: attachment.sizes[ size ].height,
+ width: attachment.sizes[ size ].width,
+ src: attachment.sizes[ size ].url,
+ srcset: srcset
+ } );
+
+ $( '.site-logo-link' ).show();
+ $( 'body' ).addClass( 'wp-site-logo' );
+ } );
+
+ api( 'site_logo', function( setting ) {
+ setting.bind( function( newValue ) {
+ if ( ! newValue ) {
+ $( '.site-logo-link' ).hide();
+ $( 'body' ).removeClass( 'wp-site-logo' );
+ }
+ } );
+
+ // Focus on the control when the logo is clicked, if there is no site_logo partial.
+ if ( ! api.selectiveRefresh || ! api.selectiveRefresh.partial.has( 'site_logo' ) ) {
+ $( document.body ).on( 'click', '.site-logo-link', function( e ) {
+ if ( ! e.shiftKey ) {
+ return;
+ }
+ api.preview.send( 'focus-control-for-setting', 'site_logo' );
+ } );
+ $( '.site-logo-link' ).attr( 'title', api.settings.l10n.shiftClickToEdit );
+ }
+ } );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> api.trigger( 'preview-ready' );
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesposttemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/post-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/post-template.php 2016-02-24 21:48:02 UTC (rev 36697)
+++ trunk/src/wp-includes/post-template.php 2016-02-24 22:09:54 UTC (rev 36698)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -706,6 +706,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( get_background_color() !== get_theme_support( 'custom-background', 'default-color' ) || get_background_image() )
</span><span class="cx" style="display: block; padding: 0 10px"> $classes[] = 'custom-background';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( has_site_logo() ) {
+ $classes[] = 'wp-site-logo';
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $page = $wp_query->get( 'page' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $page || $page < 2 )
</span></span></pre>
</div>
</div>
</body>
</html>