Sitemaps: Add better support for RTL sites.

While the URLs are intended to be machine readable, they should always be LTR, while other data would be RTL in the sitemap.

Fixes #50449.

Props joyously, SergeyBiryukov, pbiron. apedog, ramiy.


Built from https://develop.svn.wordpress.org/trunk@48414


git-svn-id: http://core.svn.wordpress.org/trunk@48183 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
whyisjake 2020-07-10 00:50:04 +00:00
parent 35257c2e2d
commit 68e56464c4
2 changed files with 40 additions and 27 deletions

View File

@ -248,7 +248,10 @@ XSL;
* @return string The CSS.
*/
public function get_stylesheet_css() {
$css = '
$text_align = is_rtl() ? 'right' : 'left';
$css = <<<EOF
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
color: #444;
@ -259,8 +262,17 @@ XSL;
border-collapse: collapse;
}
#sitemap__table tr td.loc {
/*
* URLs should always be LTR.
* see https://core.trac.wordpress.org/ticket/16834 and
* https://core.trac.wordpress.org/ticket/49949
*/
direction: ltr;
}
#sitemap__table tr th {
text-align: left;
text-align: {$text_align};
}
#sitemap__table tr td,
@ -274,7 +286,8 @@ XSL;
a:hover {
text-decoration: none;
}';
}
EOF;
/**
* Filters the CSS only for the sitemap stylesheet.

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.5-beta1-48413';
$wp_version = '5.5-beta1-48414';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.