WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#39627 closed defect (bug) (fixed)

Custom Logo: Use correct theme mod in _media_states()

Reported by: pbiron Owned by: SergeyBiryukov
Milestone: 4.8 Priority: normal
Severity: normal Version: 4.5
Component: Media Keywords: good-first-bug has-patch
Focuses: Cc:

Description

in wp-admin/includes/template.php,

function _media_states ( $post ) {
...
if ( $post->ID == get_theme_mod( 'site_logo' ) ) {
		$media_states[] = __( 'Logo' );
	}

should be

function _media_states ( $post ) {
...
if ( $post->ID == get_theme_mod( 'custom_logo' ) ) {
		$media_states[] = __( 'Logo' );
	}

As a result, when the Theme Customizer is used to add a custom logo, the image added as the custom logo is not tag as such in the Media Library because the wrong theme mod $name is checked.

Attachments (1)

39627.patch (442 bytes) - added by mitraval192 4 years ago.
I have changed the mod $name

Download all attachments as: .zip

Change History (5)

#1 @swissspidy
4 years ago

  • Component changed from Customize to Media
  • Keywords needs-patch good-first-bug added
  • Milestone changed from Awaiting Review to Future Release
  • Summary changed from Logo media state to Custom Logo: Use correct theme mod in _media_states()
  • Version changed from 4.6.1 to 4.5

Thanks for reporting this!

Introduced in #33755 / [36698]. Forgotten in [36837]

@mitraval192
4 years ago

I have changed the mod $name

#2 @mitraval192
4 years ago

  • Keywords has-patch added; needs-patch removed

#3 @SergeyBiryukov
4 years ago

  • Milestone changed from Future Release to 4.8

#4 @SergeyBiryukov
4 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 39925:

Media: After [36837], check the correct theme modification name for custom logo in _media_states().

Props pbiron, mitraval192.
Fixes #39627.

Note: See TracTickets for help on using tickets.