From 36f9f6c70d21753c6faddb63f1fd5fe0d01d89c4 Mon Sep 17 00:00:00 2001 From: Jake Spurlock Date: Fri, 10 Jul 2020 00:48:54 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@48414 602fd350-edb4-49c9-b593-d223f7449a82 --- .../sitemaps/class-wp-sitemaps-stylesheet.php | 65 +++++++++++-------- 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php index 490541ab28..829e50813a 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php +++ b/src/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 = <<