Opened 14 years ago
Closed 14 years ago
#22653 closed enhancement (duplicate)
Extra spaces in wp_title
| Reported by: | nbspjr | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Template | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
Greetings.
wp_title adds extra spaces to the title even if separator is set to be empty. The spaces are added on the side where separator's location is set. For example, if I have title "Blog", then wp_title(""); will output " Blog" and wp_title("", "right"); - "Blog ". At this moment I have to call 'wp_title' filter to trim spaces if there is empty separator passed, something like this:
function my_wp_title($title, $sep, $loc) {
return ( empty($sep) ) ? trim($title) : $title;
}
add_filter('wp_title', 'my_wp_title', 10, 3);
What do you think of enhancing wp_title function to not add spaces if there is an empty separator?
Change History (1)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Duplicate of #19674.