mirror of
https://github.com/inretio/WordPress-Plugin-Boilerplate
synced 2024-12-22 20:03:53 +02:00
Moved load_plugin_textdomain()
This commit is contained in:
parent
a74004d26c
commit
696d133f36
1 changed files with 12 additions and 4 deletions
12
plugin.php
12
plugin.php
|
@ -38,8 +38,8 @@ class PluginName {
|
|||
*/
|
||||
function __construct() {
|
||||
|
||||
// TODO: replace "plugin-name-locale" with a unique value for your plugin
|
||||
load_plugin_textdomain( 'plugin-name-locale', false, dirname( plugin_basename( __FILE__ ) ) . '/lang' );
|
||||
// load plugin text domain
|
||||
add_action( 'init', array( $this, 'textdomain' ) );
|
||||
|
||||
// Register admin styles and scripts
|
||||
add_action( 'admin_print_styles', array( $this, 'register_admin_styles' ) );
|
||||
|
@ -86,6 +86,14 @@ class PluginName {
|
|||
// TODO define deactivation functionality here
|
||||
} // end deactivate
|
||||
|
||||
/**
|
||||
* Loads the plugin text domain for translation
|
||||
*/
|
||||
public function textdomain() {
|
||||
// TODO: replace "plugin-name-locale" with a unique value for your plugin
|
||||
load_plugin_textdomain( 'plugin-name-locale', false, dirname( plugin_basename( __FILE__ ) ) . '/lang' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers and enqueues admin-specific styles.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue