| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Insert Special Characters |
| 4 |
* Plugin URI: https://github.com/10up/insert-special-characters |
| 5 |
* Description: A Special Character inserter for the WordPress block editor (Gutenberg). |
| 6 |
* Version: 1.0.4 |
| 7 |
* Requires at least: 5.2 |
| 8 |
* Requires PHP: 5.6 |
| 9 |
* Author: 10up |
| 10 |
* Author URI: https://10up.com |
| 11 |
* License: GPLv2 |
| 12 |
* License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
| 13 |
* Text Domain: insert-special-characters |
| 14 |
* |
| 15 |
* @package insert-special-characters |
| 16 |
*/ |
| 17 |
namespace InsertSpecialCharacters; |
| 18 |
|
| 19 |
/** |
| 20 |
* Enqueue the admin JavaScript assets. |
| 21 |
*/ |
| 22 |
function gcm_block_enqueue_scripts() { |
| 23 |
$asset_data_file = trailingslashit( plugin_dir_path( __FILE__ ) ) . 'build/index.asset.php'; |
| 24 |
|
| 25 |
if ( ! file_exists( $asset_data_file ) ) { |
| 26 |
return; |
| 27 |
} |
| 28 |
|
| 29 |
$script_data = include $asset_data_file; |
| 30 |
|
| 31 |
wp_enqueue_script( |
| 32 |
'insert-special-characters', |
| 33 |
plugin_dir_url( __FILE__ ) . 'build/index.js', |
| 34 |
$script_data['dependencies'], |
| 35 |
$script_data['version'], |
| 36 |
true |
| 37 |
); |
| 38 |
|
| 39 |
wp_set_script_translations( 'insert-special-characters', 'insert-special-characters' ); |
| 40 |
} |
| 41 |
add_action( 'enqueue_block_editor_assets', __NAMESPACE__ . '\gcm_block_enqueue_scripts' ); |
| 42 |
|