Opened 21 years ago
Closed 20 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 |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Template | Version: | 2.1 |
| Severity: | minor | Keywords: | dev-feedback 2nd-opinion |
| Cc: | Focuses: |
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
@
20 years ago
- Keywords dev-feedback 2nd-opinion added
- Owner changed from to
- Status new → assigned
- Version 2.0.4 → 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?
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
It can be solved changing the template like this:
<h2>Páginas</h2>
<ul>
<?php wp_list_pages('title_li='); ?>
</ul>