Opened 19 years ago
Closed 18 years ago
#1274 closed defect (bug) (wontfix)
Problem passing a 'title_li' with HTML entities to wp_list_pages()
Reported by: | anonymousbugger | Owned by: | rob1n |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | 2.1 |
Component: | Template | Keywords: | dev-feedback 2nd-opinion |
Focuses: | Cc: |
Description
There are a problem with use of parse_str() function to parse the arguments passed to the wp_list_pages() function. If you want to write a word with HTML entities on the "title_li" argument the system cut the word at the first "&". This is really important in non english languages that uses tildes, acutes, etc.
Ex.: <?php wp_list_pages('title_li=<h2>Páginas</h2>' ); ?>
Become: <h2>P
I put an quick&dirty hack on "Additional Information".
PS: This is my first Report so, I'm sorry if this is not the correct way to solve the issue :)
Change History (6)
#4
@
18 years ago
- Keywords dev-feedback 2nd-opinion added
- Owner changed from anonymous to rob1n
- Status changed from new to assigned
- Version changed from 2.0.4 to 2.1
This is more a limitation of the parse_str function, which is what PHP uses to parse the query string-style arguments. I don't know how we could fix this, except for some ugly hacks or taking it in traditional-style function arguments, but that defeats the whole purpose of using query strings in the first place.
I would recommend solving this by doing title_li= and putting the H2 seperately, as is in comment 3. But how about for other arguments that may need entities?
It can be solved changing the template like this:
<h2>Páginas</h2>
<ul>
<?php wp_list_pages('title_li='); ?>
</ul>