Server IP : 192.158.238.246 / Your IP : 18.217.162.18 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/7779/cwd/plugins/code-snippets/php/front-end/ |
Upload File : |
<?php /** * For some reason, WordPress requires that TinyMCE translations be hosted in an external file. So that's what this is. * * @package Code_Snippets */ namespace Code_Snippets; use _WP_Editors; /** * Variable types. * * @var array<string, string|array<string, Snippet[]>> $strings */ $strings = [ 'insert_content_menu' => __( 'Content Snippet', 'code-snippets' ), 'insert_content_title' => __( 'Insert Content Snippet', 'code-snippets' ), 'snippet_label' => __( 'Snippet', 'code-snippets' ), 'php_att_label' => __( 'Run PHP code', 'code-snippets' ), 'format_att_label' => __( 'Apply formatting', 'code-snippets' ), 'shortcodes_att_label' => __( 'Enable shortcodes', 'code-snippets' ), 'insert_source_menu' => __( 'Snippet Source Code', 'code-snippets' ), 'insert_source_title' => __( 'Insert Snippet Source', 'code-snippets' ), 'show_line_numbers_label' => __( 'Show line numbers', 'code-snippets' ), ]; $strings = array_map( 'esc_js', $strings ); $snippets = get_snippets(); $strings['all_snippets'] = []; $strings['content_snippets'] = []; foreach ( $snippets as $snippet ) { if ( 'content' === $snippet->scope ) { $strings['content_snippets'][ $snippet->id ] = $snippet->display_name; } $strings['all_snippets'][ $snippet->id ] = sprintf( '%s (%s)', $snippet->display_name, strtoupper( $snippet->type ) ); } asort( $strings['all_snippets'], SORT_STRING | SORT_FLAG_CASE ); asort( $strings['content_snippets'], SORT_STRING | SORT_FLAG_CASE ); $strings = [ _WP_Editors::$mce_locale => [ 'code_snippets' => $strings ] ]; /** $strings is used by outer file. @noinspection PhpUnusedLocalVariableInspection */ $strings = 'tinyMCE.addI18n(' . wp_json_encode( $strings ) . ');';