[wp-trac] [WordPress Trac] #33755: Add Site Logo to WordPress Core
WordPress Trac
noreply at wordpress.org
Thu Feb 18 20:34:06 UTC 2016
#33755: Add Site Logo to WordPress Core
-------------------------------------------------+-------------------------
Reporter: fatmedia | Owner:
Type: feature request | Status: reopened
Priority: normal | Milestone: 4.5
Component: Customize | Version: trunk
Severity: normal | Resolution:
Keywords: ux-feedback has-patch needs-testing | Focuses: ui
needs-unit-tests has-screenshots |
-------------------------------------------------+-------------------------
Comment (by celloexpressions):
Replying to [comment:39 melchoyce]:
> > This should be a theme-specific setting. The theme has a better idea
of what size restrictions there are and can possibly help with
positioning. Why not let the customizer do it's thing?
>
> That's exactly what this feature is doing — providing a standardized way
for themes to offer logo support, exactly like header and background
images. This UI won't just show up randomly, it will only exist if a theme
tells it to exist.
> > Does this solution need to be global? (stays set no matter which theme
is active regardless of theme support)
>
> No, that's not what this is doing. This was never going to be global.
This is not a global setting, it's an `add_theme_support()`.
If we're talking theme-specific, why is it an `option`, and not a
`theme_mod`? I think that distinction could be confusing, but it also
could make sense if properly applied. If it's a theme mod, the theme can
specify suggested sizes, etc. If it's an `option`, it's global, even if
the UI isn't always shown.
It is really not difficult for themes to implement a site logo, or even to
do it in a way that will play nicely with other themes if the `option`
route is desired:
{{{
add_action( 'customize_register', 'core_33733_customize_register' );
function core_33755_customize_register( $wp_customize ) {
$wp_customize->add_setting( 'site_logo', array( 'type' => 'option'
) );
$wp_customize->add_control( new WP_Customize_Image_Control(
$wp_customize, 'site_logo', array(
'label' => __( 'Site Logo' ),
'section' => 'title_tagline',
)));
}
// in header.php, etc.
<img class="site-logo" src="<?php echo esc_url( get_option( 'site_logo' )
); ?> ">
}}}
Also, my primary question remains to be answered. I have no doubt that
people like the feature in Jetpack, or that it can be made to work
alongside site icon (though I do still think there is redundancy in a lot
of cases), but '''for how many users will there be a need for a site logo
that is distinct from a site icon?''' This really needs to be quantified
in some way before we merge this into core; not sure what percentage is
appropriate but this wouldn't necessarily follow the 80/20 rule because of
theme support. We're making too many assumptions right now.
Aside: I like the redesign of the site icon UI, but that really needs to
go into its own ticket. Tying it in with site icon feels wrong, regardless
of when/how it comes into core. There is a substantial enough amount of
code required for the changes that this piece needs to be broken out and
reviewed separately for UI and code.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33755#comment:51>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list