WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#8000 closed defect (bug) (fixed)

wp_register_style should default the media to 'all'

Reported by: filosofo Owned by:
Milestone: 2.7 Priority: normal
Severity: normal Version: 2.7
Component: Template Keywords: konqueror wp_register_style wp_enqueue_style wp_styles has-patch
Focuses: Cc:

Description

What makes this a defect is that some browsers, such as Konqueror, will disregard the stylesheet if the media attribute is empty.

By default, if you register a style like so:

wp_register_style('handle', 'path/to/style.css'); 

The media is set to false, so it comes out like this:

<link rel='stylesheet' href='/path/to/style.css?vers=whatever' type='text/css' media='' />

The do_item() method of WP_Styles does set media to "all" if $media is unset. However, when it comes from wp_enqueue_style on default, the media variable is set---to false.

Attachments (1)

default.styles.diff (610 bytes) - added by filosofo 5 years ago.

Download all attachments as: .zip

Change History (2)

filosofo5 years ago

comment:1 westi5 years ago

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

(In [9404]) Default media type to all. Fixes #8000 props filosofo.

Note: See TracTickets for help on using tickets.