| @@ -1,19 +1,20 @@ | ||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly | |
| 2 | + | |
| 3 | 3 | add_action( 'init', 'deepl_init_admin', 40 ); |
| 4 | 4 | function deepl_init_admin() { |
| 5 | 5 | if ( !is_admin() ) { |
| 6 | 6 | return; |
| 7 | 7 | } |
| 8 | + | |
| 8 | 9 | if ( DeepLConfiguration::isPluginInstalled() === false ) { |
| 9 | 10 | deepl_install_plugin(); |
| 10 | 11 | } |
| 11 | 12 | |
| 12 | - global $wpdeepl_WP_Improved_Settings_DeepL; | |
| 13 | + global $WP_Improved_Settings_DeepL; | |
| 13 | 14 | |
| 14 | - if ( !$wpdeepl_WP_Improved_Settings_DeepL ) { | |
| 15 | - $wpdeepl_WP_Improved_Settings_DeepL = new wpdeepl_WP_Improved_Settings\wpdeepl_WP_Improved_Settings_DeepL(); | |
| 15 | + if ( !$WP_Improved_Settings_DeepL ) { | |
| 16 | + $WP_Improved_Settings_DeepL = new WP_Improved_Settings_DeepL(); | |
| 16 | 17 | } |
| 17 | 18 | |
| 18 | 19 | global $DeepL_Metabox; |
| 19 | 20 | $DeepL_Metabox = new DeepL_Metabox(); |
| @@ -23,12 +24,12 @@ | ||
| 23 | 24 | add_action( 'admin_enqueue_scripts', 'deepl_load_admin_javascript' ); |
| 24 | 25 | function deepl_load_admin_javascript( $hook ) { |
| 25 | 26 | |
| 26 | 27 | if ( $hook == 'settings_page_deepl_settings' ) { |
| 27 | - wp_enqueue_style( 'deepl_admin', WPDEEPL_URL . '/assets/wpdeepl-admin.css', array(), WPDEEPL_VERSION ); | |
| 28 | + wp_enqueue_style( 'deepl_admin', WPDEEPL_URL . '/assets/deepl-admin.css', array(), WPDEEPL_VERSION ); | |
| 28 | 29 | } |
| 29 | 30 | if ( $hook == 'settings_page_deepl_settings' || $hook == 'post.php' || $hook == 'post-new.php' ) { |
| 30 | - wp_enqueue_script( 'deepl_admin', trailingslashit( WPDEEPL_URL ) . 'assets/wpdeepl-metabox.js', false, WPDEEPL_VERSION, true ); | |
| 31 | + wp_enqueue_script( 'deepl_admin', trailingslashit( WPDEEPL_URL ) . 'assets/deepl-metabox.js' ); | |
| 31 | 32 | wp_localize_script( 'deepl_admin', 'DeepLStrings', deepl_get_localized_strings() ); |
| 32 | 33 | } |
| 33 | 34 | } |
| 34 | 35 | |
| @@ -85,7 +86,7 @@ | ||
| 85 | 86 | esc_url( $edit_link ), |
| 86 | 87 | 'Test' |
| 87 | 88 | ); |
| 88 | 89 | } |
| 89 | - //wpdeepl_debug_display( $actions ); | |
| 90 | + //plouf( $actions ); | |
| 90 | 91 | return $actions; |
| 91 | 92 | } |