Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#10759 closed defect (bug) (invalid)

Bug: wp_register_style does not allow stylesheets with parameters

Reported by: mark8barnes's profile mark8barnes Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8.4
Component: General Keywords:
Focuses: Cc:

Description

Sometimes its useful to use PHP to generate stylesheets. Unfortunately, it's not possible to pass parameters to the stylesheets because wp_register_style gets confused. For example:

wp_register_style('sb_style', get_option('siteurl').'?sermon-browser-style', false, $version);

generates

http://domain.com?sb_style&ver=1252494619

rather than

http://domain.com?sb_style&ver=1252494619

The bug is presumably in WP_Styles

Change History (3)

#1 @sivel
14 years ago

  • Keywords WP_Styles wp_register_style parameters removed
  • Milestone 2.9 deleted
  • Resolution set to invalid
  • Status changed from new to closed

This is not a bug, but the way that the function is intended to work. The & character by itself is an illegal entity in XHTML. So & is normally replaced with & however & is a correct html entity for the &.

This was discussed several months ago on the wp-hackers list in this thread: http://lists.automattic.com/pipermail/wp-hackers/2009-February/thread.html#25046

In short it was proven that the function is acting as expected and there are no bad side effects from the way that it does things. The thread actually refers to wp_enqueue_script but it is the same principal in the end.

#2 @hakre
14 years ago

my 2 cents: wp_register_style() does not return a value. The reporter must refrain to some other function then. As sivel already stated that might be obvious anyway. +1 for invalid.

Please always add the context(s) of in- and output in your reports. Thanks.

Note: See TracTickets for help on using tickets.