Opened 9 years ago
Closed 8 years ago
#2106 closed defect (bug) (fixed)
WordPress.tv: Filter intended to prevent orphaned words creates them
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Component: | WordPress.tv | Keywords: | |
| Cc: |
Description
On WordPress.tv, there's a code that adds before the last word in video titles.
I could not find it in the open sourced theme, but I guess it's similar to rosetta_orphan_control() in Rosetta:
/**
* Makes final space a non-breaking one, to prevent orphaned word.
*
* @param string $string
* @return string
*/
function rosetta_orphan_control( $string ) {
return substr_replace( $string, ' ', strrpos( $string, ' ' ), 1 );
}
add_filter( 'no_orphans', 'rosetta_orphan_control' );
The problem is that it doesn't work well for languages with longer words, see the screenshot.
As seen on http://wordpress.tv/event/wordcamp-moscow-2016/, this title does not wrap correctly with :
Варвара Лялягина: Как стать идеальным заказчиком
The function should probably only replace spaces preceded by shorter words (1 to 3 letters or so).
Attachments (1)
Change History (2)
Note: See
TracTickets for help on using
tickets.
In 6380: