Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#48112 closed defect (bug) (fixed)

Undefined $type_attr for TwentyTwenty When A Custom Background is Set

Reported by: davidbaumwald Owned by: SergeyBiryukov
Priority: normal Milestone: 5.3
Component: Customize Version: 5.3
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

[46164] introduced a type attribute one the inline <style> tag when a custom background is defined in the Customizer. This produces a notice:

Notice: Undefined variable: type_attr in wp-includes\theme.php on line 1708

The notice is thrown inline in the render, making the <style> tag malformed and not used.

The attached patch moves the $type_attr assignment out of the conditional which is only evaluated in certain themes.

Attachments (1)

48112.diff​ (651 bytes ) - added by davidbaumwald 7 years ago.
Patch

Download all attachments as: .zip

Change History (6)

#1 @SergeyBiryukov
7 years ago

  • Owner set to SergeyBiryukov
  • Status new → reviewing
  • Summary Undefinred $type_attr for TwentyTwenty When A Custom Background is Set → Undefined $type_attr for TwentyTwenty When A Custom Background is Set

#3 @SergeyBiryukov
7 years ago

  • Resolution → fixed
  • Status reviewing → closed

In 46270:

Themes: After [46164], make sure $type_attr is always defined in _custom_background_cb().

Props davidbaumwald.
Fixes #48112.

This ticket was mentioned in ​Slack in #core-themes by desrosj. ​View the logs.


7 years ago

#5 @SergeyBiryukov
7 years ago

#48107 was marked as a duplicate.

Note: See TracTickets for help on using tickets.