Last active
December 10, 2015 22:28
-
-
Save SleeplessByte/4501807 to your computer and use it in GitHub Desktop.
Loads the textdomain for a plugin.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Preferably the plugin is (in) a class, so use: | |
* add_action( array( &$this, 'textdomain_init'); | |
*/ | |
add_action( 'plugins_loaded', 'textdomain_init' ); | |
/** | |
* Initializes the textdomain for this plugin | |
*/ | |
function textdomain_init() { | |
$plugin_dir = basename( plugin_dir_url( __FILE__ ) ); | |
load_plugin_textdomain( 'domain' , false , $plugin_dir . '/languages' ); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment