Filter hook 'wp_mce_translation'

in WP Core File wp-includes/class-wp-editor.php at line 1487

View Source

wp_mce_translation

Filter Hook
Description
Filters translated strings prepared for TinyMCE.

Hook Information

File Location wp-includes/class-wp-editor.php View on GitHub
Hook Type Filter
Line Number 1487

Hook Parameters

Type Name Description
array $mce_translation Key/value pairs of strings.
string $mce_locale Locale.

Usage Examples

Basic Usage
<?php
// Hook into wp_mce_translation
add_filter('wp_mce_translation', 'my_custom_filter', 10, 2);

function my_custom_filter($mce_translation, $mce_locale) {
    // Your custom filtering logic here
    return $mce_translation;
}

Source Code Context

wp-includes/class-wp-editor.php:1487 - How this hook is used in WordPress core
<?php
1482  		 * @since 3.9.0
1483  		 *
1484  		 * @param array  $mce_translation Key/value pairs of strings.
1485  		 * @param string $mce_locale      Locale.
1486  		 */
1487  		$mce_translation = apply_filters( 'wp_mce_translation', $mce_translation, $mce_locale );
1488  
1489  		foreach ( $mce_translation as $key => $value ) {
1490  			// Remove strings that are not translated.
1491  			if ( $key === $value ) {
1492  				unset( $mce_translation[ $key ] );

PHP Documentation

<?php
/**
		 * Filters translated strings prepared for TinyMCE.
		 *
		 * @since 3.9.0
		 *
		 * @param array  $mce_translation Key/value pairs of strings.
		 * @param string $mce_locale      Locale.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/class-wp-editor.php
Related Hooks

Related hooks will be displayed here in future updates.