Changeset 30296
- Timestamp:
- 11/10/2014 02:07:00 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-editor.php
r30294 r30296 737 737 } 738 738 739 public static function wp_mce_translation() { 739 /** 740 * Translates the default TinyMCE strings and returns them as JSON encoded object ready to be loaded with tinymce.addI18n(). 741 * Can be used directly (_WP_Editors::wp_mce_translation()) by passing the same locale as set in the TinyMCE init object. 742 * 743 * @param string $mce_locale The locale used for the editor. 744 * @param bool $json_only optional Whether to include the Javascript calls to tinymce.addI18n() and tinymce.ScriptLoader.markDone(). 745 * @return The translation object, JSON encoded. 746 */ 747 public static function wp_mce_translation( $mce_locale = '', $json_only = false ) { 740 748 741 749 $mce_translation = array( … … 963 971 */ 964 972 965 $baseurl = self::$baseurl; 966 $mce_locale = self::$mce_locale; 973 if ( ! $mce_locale ) { 974 $mce_locale = self::$mce_locale; 975 } 967 976 968 977 /** … … 992 1001 $mce_translation['_dir'] = 'rtl'; 993 1002 } 1003 1004 if ( $json_only ) { 1005 return wp_json_encode( $mce_translation ); 1006 } 1007 1008 $baseurl = self::$baseurl ? self::$baseurl : includes_url( 'js/tinymce' ); 994 1009 995 1010 return "tinymce.addI18n( '$mce_locale', " . wp_json_encode( $mce_translation ) . ");\n" .
Note: See TracChangeset
for help on using the changeset viewer.