From 046fb838e309ec1e2b985c98679a439b5bab39b8 Mon Sep 17 00:00:00 2001
From: Paul Biron <paul@sparrowhawkcomputing.com>
Date: Thu, 9 Jul 2020 12:50:25 -0600
Subject: [PATCH] Ensure the URLs are always LTR.
---
.../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
|
b
|
XSL; |
| 248 | 248 | * @return string The CSS. |
| 249 | 249 | */ |
| 250 | 250 | public function get_stylesheet_css() { |
| 251 | | $css = ' |
| 252 | | body { |
| 253 | | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; |
| 254 | | color: #444; |
| 255 | | } |
| | 251 | $text_align = is_rtl() ? 'right' : 'left'; |
| 256 | 252 | |
| 257 | | #sitemap__table { |
| 258 | | border: solid 1px #ccc; |
| 259 | | border-collapse: collapse; |
| 260 | | } |
| 261 | | |
| 262 | | #sitemap__table tr th { |
| 263 | | text-align: left; |
| 264 | | } |
| 265 | | |
| 266 | | #sitemap__table tr td, |
| 267 | | #sitemap__table tr th { |
| 268 | | padding: 10px; |
| 269 | | } |
| 270 | | |
| 271 | | #sitemap__table tr:nth-child(odd) td { |
| 272 | | background-color: #eee; |
| 273 | | } |
| 274 | | |
| 275 | | a:hover { |
| 276 | | text-decoration: none; |
| 277 | | }'; |
| | 253 | $css = <<<EOF |
| | 254 | |
| | 255 | body { |
| | 256 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; |
| | 257 | color: #444; |
| | 258 | } |
| | 259 | |
| | 260 | #sitemap__table { |
| | 261 | border: solid 1px #ccc; |
| | 262 | border-collapse: collapse; |
| | 263 | } |
| | 264 | |
| | 265 | #sitemap__table tr td.loc { |
| | 266 | /* |
| | 267 | * URLs should always be LTR. |
| | 268 | * see https://core.trac.wordpress.org/ticket/16834 and |
| | 269 | * https://core.trac.wordpress.org/ticket/49949 |
| | 270 | */ |
| | 271 | direction: ltr; |
| | 272 | } |
| | 273 | |
| | 274 | #sitemap__table tr th { |
| | 275 | text-align: {$text_align}; |
| | 276 | } |
| | 277 | |
| | 278 | #sitemap__table tr td, |
| | 279 | #sitemap__table tr th { |
| | 280 | padding: 10px; |
| | 281 | } |
| | 282 | |
| | 283 | #sitemap__table tr:nth-child(odd) td { |
| | 284 | background-color: #eee; |
| | 285 | } |
| | 286 | |
| | 287 | a:hover { |
| | 288 | text-decoration: none; |
| | 289 | } |
| | 290 | EOF; |
| 278 | 291 | |
| 279 | 292 | /** |
| 280 | 293 | * Filters the CSS only for the sitemap stylesheet. |