Loads the theme’s textdomain.
Description
Translation files are not inherited from the parent theme. TODO: If this fails for the child theme, it should probably try to load the parent theme’s translations.
Source
public function load_textdomain() {
if ( isset( $this->textdomain_loaded ) ) {
return $this->textdomain_loaded;
}
$textdomain = $this->get( 'TextDomain' );
if ( ! $textdomain ) {
$this->textdomain_loaded = false;
return false;
}
if ( is_textdomain_loaded( $textdomain ) ) {
$this->textdomain_loaded = true;
return true;
}
$path = $this->get_stylesheet_directory();
$domainpath = $this->get( 'DomainPath' );
if ( $domainpath ) {
$path .= $domainpath;
} else {
$path .= '/languages';
}
$this->textdomain_loaded = load_theme_textdomain( $textdomain, $path );
return $this->textdomain_loaded;
}
Changelog
Version | Description |
---|---|
3.4.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.