Filter hook 'lang_dir_for_domain'

in WP Core File wp-includes/class-wp-textdomain-registry.php at line 105

View Source

lang_dir_for_domain

Filter Hook
Description
Filters the determined languages directory path for a specific domain and locale.

Hook Information

File Location wp-includes/class-wp-textdomain-registry.php View on GitHub
Hook Type Filter
Line Number 105

Hook Parameters

Type Name Description
string|false $path Languages directory path for the given domain and locale.
string $domain Text domain.
string $locale Locale.

Usage Examples

Basic Usage
<?php
// Hook into lang_dir_for_domain
add_filter('lang_dir_for_domain', 'my_custom_filter', 10, 3);

function my_custom_filter($path, $domain, $locale) {
    // Your custom filtering logic here
    return $path;
}

Source Code Context

wp-includes/class-wp-textdomain-registry.php:105 - How this hook is used in WordPress core
<?php
 100  		 *
 101  		 * @param string|false $path   Languages directory path for the given domain and locale.
 102  		 * @param string       $domain Text domain.
 103  		 * @param string       $locale Locale.
 104  		 */
 105  		return apply_filters( 'lang_dir_for_domain', $path, $domain, $locale );
 106  	}
 107  
 108  	/**
 109  	 * Determines whether any MO file paths are available for the domain.
 110  	 *

PHP Documentation

<?php
/**
		 * 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.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/class-wp-textdomain-registry.php
Related Hooks

Related hooks will be displayed here in future updates.