Skip to content

Instantly share code, notes, and snippets.

@dotherightthing
Created August 15, 2019 09:55
Show Gist options
  • Save dotherightthing/1b6c16488bccac645e6845d0e6e33133 to your computer and use it in GitHub Desktop.
Save dotherightthing/1b6c16488bccac645e6845d0e6e33133 to your computer and use it in GitHub Desktop.
[Providing theme translations] #wordpress

Providing theme translations

Created: 2017.04.08

The Text Domain is defined in style.css:

/*
Theme Name: KB
Theme URI: http://kb.dotherightthing.co.nz
Author: Do The Right Thing
Author URI: http://www.dotherightthing.co.nz
Description: A template for useful code snippets and the accompanying documentation
Version: 0.2.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kb
Tags: developer knowledgebase code wiki
*/

This value can be retrieved by querying the WP_Theme Object:

$my_theme = wp_get_theme();
echo $my_theme->get( 'TextDomain' ); // kb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment