load_child_theme_textdomain

Load the child themes translated strings.

Description

load_child_theme_textdomain( (string) $domain, (bool) $path = false ); 

If the current locale exists as a .mo file in the child themes root directory, it will be included in the translated strings by the $domain.

The .mo files must be named based on the locale exactly.

Parameters (2)

0. $domain (string)
Text domain. Unique identifier for retrieving translated strings.
1. $path — Optional. (bool) => false
Path to the directory containing the .mo file. Default false.

Usage

  1. if ( !function_exists( 'load_child_theme_textdomain' ) ) { 
  2. require_once ABSPATH . WPINC . '/l10n.php'; 
  3.  
  4. // Text domain. Unique identifier for retrieving translated strings. 
  5. $domain = ''; 
  6.  
  7. // Optional. Path to the directory containing the .mo file. 
  8. // Default false. 
  9. $path = false; 
  10.  
  11. // NOTICE! Understand what this does before running. 
  12. $result = load_child_theme_textdomain($domain, $path); 
  13.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/l10n.php  
  1. function load_child_theme_textdomain( $domain, $path = false ) { 
  2. if ( ! $path ) 
  3. return load_theme_textdomain( $domain, $path );