[wp-trac] [WordPress Trac] #11160: Inconsistancies in Naming and Using Sidebar Names and IDs.

WordPress Trac wp-trac at lists.automattic.com
Tue Jan 5 21:29:21 UTC 2010


#11160: Inconsistancies in Naming and Using Sidebar Names and IDs.
-----------------------------+----------------------------------------------
 Reporter:  CharlesClarkson  |       Owner:  azaozz                 
     Type:  defect (bug)     |      Status:  new                    
 Priority:  normal           |   Milestone:  3.0                    
Component:  Widgets          |     Version:  2.9                    
 Severity:  normal           |    Keywords:  has-patch needs-testing
-----------------------------+----------------------------------------------

Comment(by hakre):

 Replying to [comment:8 azaozz]:
 > Perhaps it would be better to standardize dynamic_sidebar() and require
 a name and a proper ID for each sidebar. We need to revisit the widgets
 API and remove deprecated functions anyways. I suggest to declare it's
 syntax like ''[5] Name'' in [http://www.w3.org/TR/REC-xml/#d0e804 Names
 and Tokens (XML 1.0)]:

 {{{
 [4]     NameStartChar ::=  ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] |
 [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] |
 [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] |
 [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
 [4a]    NameChar      ::=  NameStartChar | "-" | "." | [0-9] | #xB7 |
 [#x0300-#x036F] | [#x203F-#x2040]
 [5]     Name          ::=  NameStartChar (NameChar)*
 [6]     Names         ::=  Name (#x20 Name)*
 [7]     Nmtoken       ::=  (NameChar)+
 [8]     Nmtokens      ::=  Nmtoken (#x20 Nmtoken)*
 }}}
 (this handles US-ASCII and UTF-8)

 ----

 Replying to [comment:10 CharlesClarkson]:
 > Rewriting an API may be above my pay grade, but I'm willing to give it a
 try. What functions need to be deprecated? Are we going to preserve
 backward compatibility? Is there any WordPress API standard that I could
 read or emulate?

 First of all since you have a higher insight right now into this issue I
 would name the problematic areas which need improvements in your eyes. For
 example that the edge cases are removed and what it needs in the data
 structure(s) therefore.

 In a first guess I would suggest to define the syntax of a name and I
 would take care that it will never evaluate to an integer number under any
 circumstances to prevent the side-effects you're already reporting.

 Next thing I can think of is that we do not have a propper widget API
 defined no-where (it just grew out of a plugin some time ago), so I think
 a list of existing widget and sidebar related functions is good to have to
 decide what to improve and what to drop.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11160#comment:11>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list