forked from tiptoppress/category-posts-widget
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtinymce-translations.php
40 lines (33 loc) · 958 Bytes
/
tinymce-translations.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* Register translations.
*
* @package categoryposts.
*
* @since 4.7
*/
namespace categoryPosts;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( '_WP_Editors' ) ) {
require( ABSPATH . WPINC . '/class-wp-editor.php' );
}
/**
* Register translations for the tinymce shortcode creation button and dialog.
*
* @since 4.7
*/
function tinymce_translation() {
$strings = array(
'name' => __( 'Name', 'category-posts' ),
'tooltip' => __( 'Insert Category Posts shortcode', 'category-posts' ),
'title' => __( 'Category Posts Insert Shortcode', 'category-posts' ),
'hide_message' => __( 'Hide the button', 'category-posts' ),
'profiile_url' => get_edit_user_link() . '#' . __NAMESPACE__,
);
$locale = \_WP_Editors::$mce_locale;
$translated = 'tinyMCE.addI18n("' . $locale . '.category-posts", ' . wp_json_encode( $strings ) . ");\n";
return $translated;
}
$strings = tinymce_translation();