| 1 |
<?php |
| 2 |
// If this file was called directly, abort. |
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
add_action('admin_enqueue_scripts', 'accodes_enqueue_deactivation_feedback'); |
| 7 |
function accodes_enqueue_deactivation_feedback($hook) { |
| 8 |
if ($hook !== 'plugins.php') { |
| 9 |
return; |
| 10 |
} |
| 11 |
|
| 12 |
$plugin_data = get_file_data(plugin_dir_path(__FILE__) . '../add-custom-codes.php', array('Version' => 'Version'), 'plugin'); |
| 13 |
|
| 14 |
wp_enqueue_script( |
| 15 |
'accodes-deactivate-feedback', |
| 16 |
plugins_url('deactivate-feedback.js', __FILE__), |
| 17 |
array('jquery'), |
| 18 |
$plugin_data['Version'], |
| 19 |
true |
| 20 |
); |
| 21 |
|
| 22 |
wp_localize_script('accodes-deactivate-feedback', 'accodes_feedback', array( |
| 23 |
'token' => 'rY9b@F9xM3hPzLw82dKq!xT4', |
| 24 |
'plugin_version' => $plugin_data['Version'], |
| 25 |
'wp_version' => get_bloginfo('version'), |
| 26 |
'php_version' => phpversion() |
| 27 |
)); |
| 28 |
} |