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

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @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. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.