From 68e56464c40508519009fe41bc57cdba1b8885f9 Mon Sep 17 00:00:00 2001 From: whyisjake Date: Fri, 10 Jul 2020 00:50:04 +0000 Subject: [PATCH] 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 --- .../sitemaps/class-wp-sitemaps-stylesheet.php | 65 +++++++++++-------- wp-includes/version.php | 2 +- 2 files changed, 40 insertions(+), 27 deletions(-) diff --git a/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php b/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php index 490541ab28..829e50813a 100644 --- a/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php +++ b/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php @@ -248,33 +248,46 @@ XSL; * @return string The CSS. */ public function get_stylesheet_css() { - $css = ' - body { - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - color: #444; - } + $text_align = is_rtl() ? 'right' : 'left'; - #sitemap__table { - border: solid 1px #ccc; - border-collapse: collapse; - } - - #sitemap__table tr th { - text-align: left; - } - - #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; - }'; + $css = <<