#13056 closed defect (bug) (fixed)
Invalid HTML5: Generated CSS Link
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | 2.9.2 |
Component: | Formatting | Keywords: | has-patch |
Focuses: | Cc: |
Description
The wp_head() function generates invalid HTML5 when adding an external CSS file created by a plugin.
Below is the code generated by wp_head() using the GD Star Rating plugin:
<link rel='stylesheet' id='gdsr_style_main-css' href='http://localhost/blog/wp-content/plugins/gd-star-rating/css/gdsr.css.php?t=1271711028&s=a05i05m20k20c05r05%231624%2324%23s1poxygen%23lsgflower%23lsgfountain%23lsg&o=off&ver=1.8.8' type='text/css' media='' />
The plugin author insists this is a problem with Wordpress, not with the plugin.
The relevant error according to http://validator.w3.org/check:
"One or more media queries, combined in a comma-separated list. Each media query consists of a media type and zero or more expressions that check for the conditions of particular media features. A media type is one of the following: all, braille, embossed, handheld, print, projection, screen, speech, tty, or tv. Note: The aural media type is deprecated. For information about valid media features and about the exact syntax of media queries, see the Media Queries specification."
This can be corrected by, for example, changing the default value for media from empty (media=' ') to 'screen' (media='screen').
The default value in wp_enqueue_style was set to false. I changed it to 'all' (which is what wp_register_style currently uses).
That said, there are a few inconsistencies between wp_register_style and wp_enqueue_style. I'll open another ticket.