summaryrefslogtreecommitdiffstats
path: root/wp-includes/class-wp-textdomain-registry.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:51:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:51:18 +0000
commit0e41b5d52fdc6af6442816b5f465c9db9f84e126 (patch)
treee139a90049b158d4eed892d1662ee7f5c358fa31 /wp-includes/class-wp-textdomain-registry.php
parentAdding upstream version 6.5.5+dfsg1. (diff)
downloadwordpress-0e41b5d52fdc6af6442816b5f465c9db9f84e126.tar.xz
wordpress-0e41b5d52fdc6af6442816b5f465c9db9f84e126.zip
Adding upstream version 6.6.1+dfsg1.upstream/6.6.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-includes/class-wp-textdomain-registry.php')
-rw-r--r--wp-includes/class-wp-textdomain-registry.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/wp-includes/class-wp-textdomain-registry.php b/wp-includes/class-wp-textdomain-registry.php
index fe6d04b..7037b2b 100644
--- a/wp-includes/class-wp-textdomain-registry.php
+++ b/wp-includes/class-wp-textdomain-registry.php
@@ -88,14 +88,21 @@ class WP_Textdomain_Registry {
* @param string $domain Text domain.
* @param string $locale Locale.
*
- * @return string|false MO file path or false if there is none available.
+ * @return string|false Languages directory path or false if there is none available.
*/
public function get( $domain, $locale ) {
- if ( isset( $this->all[ $domain ][ $locale ] ) ) {
- return $this->all[ $domain ][ $locale ];
- }
+ $path = $this->all[ $domain ][ $locale ] ?? $this->get_path_from_lang_dir( $domain, $locale );
- return $this->get_path_from_lang_dir( $domain, $locale );
+ /**
+ * Filters the determined languages directory path for a specific domain and locale.
+ *
+ * @since 6.6.0
+ *
+ * @param string|false $path Languages directory path for the given domain and locale.
+ * @param string $domain Text domain.
+ * @param string $locale Locale.
+ */
+ return apply_filters( 'lang_dir_for_domain', $path, $domain, $locale );
}
/**