Changeset 1518601
- Timestamp:
- 10/20/2016 01:23:46 PM (9 years ago)
- Location:
- admin-language-per-user/trunk
- Files:
-
- 3 edited
-
admin-language-per-user.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
-
templates/user-profile.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
admin-language-per-user/trunk/admin-language-per-user.php
r1492502 r1518601 3 3 Plugin Name: Admin Language Per User 4 4 Description: Lets you have your backend administration panel in english or any installed language, even if the rest of your blog is translated into another language. Language preferences can be set per user basis in user profile screen. 5 Version: 1.0. 65 Version: 1.0.7 6 6 Author: unclego 7 7 License: GPLv3 8 8 License URI: http://www.gnu.org/licenses/gpl.html 9 Tags: translation, translations, i18n, admin, english, localization, backend, language 9 Tags: translation, translations, i18n, admin, english, localization, backend, language, multisite 10 10 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6G9LJ5H8GHQ3S 11 11 */ … … 64 64 // add locale filter at proper time 65 65 add_action( 'plugins_loaded', array(get_class(), 'plugins_loaded') ); 66 66 67 // add admin language option to user profile 67 68 add_action( 'show_user_profile', array(get_class(), 'user_profile') ); 68 69 add_action( 'edit_user_profile', array(get_class(), 'user_profile') ); 70 69 71 // save language option to user profile 70 72 add_action( 'personal_options_update', array(get_class(), 'process_user_option_update') ); 71 73 add_action( 'edit_user_profile_update', array(get_class(), 'process_user_option_update') ); 74 75 // Handle user registration email locale 76 // Remove locale filter before send notification email (hook with priority 5) 77 add_action( 'register_new_user', array(get_class(), 'before_wp_send_new_user_notifications'), 5 ); 78 add_action( 'edit_user_created_user', array(get_class(), 'before_wp_send_new_user_notifications'), 5 ); 79 72 80 // Wordpress minimum version check 73 81 register_activation_hook( __FILE__, array(get_class(), 'activate') ); 82 74 83 // cleanup 75 84 register_uninstall_hook(__FILE__, array(get_class(), 'uninstall') ); … … 164 173 } 165 174 /** 175 * Remove plugin locale filter 176 * and reload default textdomain 177 */ 178 public static function before_wp_send_new_user_notifications() { 179 global $locale; 180 // trick load_default_textdomain() to call get_locale() again 181 $locale = null; 182 183 // remove filter 184 remove_filter( 'locale', array(get_class(), 'locale') ); 185 186 // and reload default textdomain 187 load_default_textdomain(); 188 } 189 /** 166 190 * @link https://codex.wordpress.org/Plugin_API/Filter_Reference/locale 167 191 * … … 191 215 * 192 216 * @return boolean 193 */ 217 */ 194 218 private static function is_tiny_mce() { 195 219 return false !== strpos( $_SERVER['REQUEST_URI'], '/wp-includes/js/tinymce/'); -
admin-language-per-user/trunk/readme.txt
r1492505 r1518601 2 2 Contributors: unclego 3 3 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6G9LJ5H8GHQ3S 4 Tags: translation, translations, i18n, admin, english, localization, backend 4 Tags: translation, translations, i18n, admin, english, localization, backend, multisite 5 5 Requires at least: 3.0.1 6 6 Tested up to: 4.6.1 … … 34 34 35 35 == Changelog == 36 = 1.0.7 = 37 = Release date: October 20th, 2016 = 38 * Fix user registration email notification when userc crated from admin panel to be in default language 39 * add HR to highlight user profile admin language section 40 * add multisite tag 41 36 42 = 1.0.6 = 37 43 = Release date: September 8th, 2016 = -
admin-language-per-user/trunk/templates/user-profile.php
r1492502 r1518601 2 2 namespace admin_language_per_user; 3 3 ?> 4 <hr> 4 5 <h2><?php _e( 'Site Language' ) ?></h2> 5 6 <table class="form-table">
Note: See TracChangeset
for help on using the changeset viewer.