| @@ -1533,9 +1533,21 @@ | ||
| 1533 | 1533 | $data['title'] = $fallback_title; |
| 1534 | 1534 | } else { |
| 1535 | 1535 | $data['title'] = $blogname; |
| 1536 | 1536 | } |
| 1537 | - $data['description'] = $settings['og_description'] ?? get_bloginfo('description'); | |
| 1537 | + // Same rule as the title above: the shipped default (the tagline) | |
| 1538 | + // is not a choice, so the homepage's meta description wins over | |
| 1539 | + // it. Without this an imported or hand-set homepage description | |
| 1540 | + // printed as the meta description while og:/twitter:description | |
| 1541 | + // kept the tagline (#897). | |
| 1542 | + $og_description = (string) ($settings['og_description'] ?? ''); | |
| 1543 | + if ($og_description !== '' && $og_description !== get_bloginfo('description')) { | |
| 1544 | + $data['description'] = $og_description; | |
| 1545 | + } elseif ($fallback_description !== null && $fallback_description !== '') { | |
| 1546 | + $data['description'] = $fallback_description; | |
| 1547 | + } else { | |
| 1548 | + $data['description'] = get_bloginfo('description'); | |
| 1549 | + } | |
| 1538 | 1550 | // Use home_url('/') so og:url matches the homepage canonical |
| 1539 | 1551 | // (class-seo-manager.php) and the WebSite schema, which both include |
| 1540 | 1552 | // the trailing slash. A bare home_url() would key a different URL in |
| 1541 | 1553 | // social caches than the canonical. |