Make WordPress Core

Opened 20 months ago

Last modified 3 months ago

#21627 new enhancement

Filter for custom-background CSS selector

Reported by: Horttcore Owned by: Horttcore
Milestone: Awaiting Review Priority: normal
Severity: trivial Version: 3.4.1
Component: Appearance Keywords: has-patch
Focuses: Cc:


There should be an easier way for changing the css selector from body to html or any other then making your own callback.

Attachments (1)

theme.diff (426 bytes) - added by Horttcore 20 months ago.
Filter applied to css selector

Download all attachments as: .zip

Change History (9)

Horttcore20 months ago

Filter applied to css selector

comment:1 nacin20 months ago

Why might modifying this selector be necessary?

comment:2 Horttcore20 months ago

With the filter you could set it to any other element i.e. html which could be better for the theme.

Here is a sample code:

body {
   margin: auto;
   width: 965px;

With the current selector just a part of the site will have the custom background.
The background should be applied to the highest element in the DOM by default and that would be html.

We could add this filter or just change the selector to the html element.

What do you prefer?

comment:3 cais20 months ago

  • Cc edward.caissie@… added

comment:4 rulatir15 months ago

Very much seconded.

comment:5 ocean907 months ago

#25379 was marked as a duplicate.

comment:6 ocean907 months ago

Having a filter in a custom callback doesn't sound like a good plan, since we cannot ensure that plugin/theme authors are including the filter in a custom callback too.

comment:7 dreamwhisper6 months ago

  • Cc dreamwhisper added

comment:8 nacin3 months ago

  • Component changed from Themes to Appearance
Note: See TracTickets for help on using tickets.