From abe582a5609e322ec1e930d1cfdf5eae8315ccc8 Mon Sep 17 00:00:00 2001
From: Paul Biron <paul@sparrowhawkcomputing.com>
Date: Tue, 30 Jun 2020 09:17:10 -0600
Subject: [PATCH] Ensure the URL column is always LTR and other columns use
is_rtl().
---
.../sitemaps/class-wp-sitemaps-stylesheet.php | 68 ++++++++++++-------
1 file changed, 42 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..8469fe88f0 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 th { |
| 266 | text-align: {$text_align}; |
| 267 | } |
| 268 | |
| 269 | #sitemap__table tr th.loc, |
| 270 | #sitemap__table tr td.loc { |
| 271 | /* |
| 272 | * URLs should always be LTR. |
| 273 | * see https://core.trac.wordpress.org/ticket/16834 and |
| 274 | * https://core.trac.wordpress.org/ticket/49949 |
| 275 | */ |
| 276 | direction: ltr; |
| 277 | text-align: left; |
| 278 | } |
| 279 | |
| 280 | #sitemap__table tr td, |
| 281 | #sitemap__table tr th { |
| 282 | padding: 10px; |
| 283 | } |
| 284 | |
| 285 | #sitemap__table tr:nth-child(odd) td { |
| 286 | background-color: #eee; |
| 287 | } |
| 288 | |
| 289 | a:hover { |
| 290 | text-decoration: none; |
| 291 | } |
| 292 | |
| 293 | EOF; |
278 | 294 | |
279 | 295 | /** |
280 | 296 | * Filters the CSS only for the sitemap stylesheet. |