| | |
| | | public function filterTitle(string $title, ?array $args): string |
| | | { |
| | | if ($args !== null) { |
| | | // Not in the loop (admin, etc.) |
| | | return $title; |
| | | } |
| | | |
| | |
| | | $resolver = $this->getResolver(); |
| | | $customTitle = $resolver->resolve($metaConfig['metaTitle']); |
| | | |
| | | return $customTitle ?: $title; |
| | | if (!$customTitle) { |
| | | return $title; |
| | | } |
| | | |
| | | // Strip trailing site name — TSF adds its own branding |
| | | $siteName = get_bloginfo('name'); |
| | | $customTitle = preg_replace('/\s*[|\-–—]\s*' . preg_quote($siteName, '/') . '\s*$/i', '', $customTitle); |
| | | |
| | | return $customTitle; |
| | | } |
| | | |
| | | /** |