get_widget_module_enabled()) { new atkp_widget(); } //** Plugin initialisieren **// add_action( 'init', 'my_affiliate_toolkit_init' ); function my_affiliate_toolkit_init() { if ( version_compare( get_bloginfo( 'version' ), '4.0', '<' ) ) { wp_die( "You must update WordPress to use affiliate-toolkit!" ); } if ( is_admin() ) { $atkp_settings = new atkp_settings( array() ); $atkp_welcome = new atkp_welcome( array() ); $atkp_settings::$settings = array( __( 'General settings', ATKP_PLUGIN_PREFIX ) => array( new atkp_settings_toolkit( array() ), 'toolkit_configuration_page' ), __( 'Advanced settings', ATKP_PLUGIN_PREFIX ) => array( new atkp_settings_advanced( array() ), 'advanced_configuration_page' ), __( 'Display settings', ATKP_PLUGIN_PREFIX ) => array( new atkp_settings_display( array() ), 'display_configuration_page' ) ); if(atkp_options::$loader->get_asa1_module_enabled() || atkp_options::$loader->get_asa2_module_enabled()) { $atkp_compatibility = new atkp_compatibility( array() ); $atkp_compatibility::$modes = array(); if(atkp_options::$loader->get_asa1_module_enabled()) { $atkp_compatibility::$modes[__( 'Amazon Simple Admin 1', ATKP_PLUGIN_PREFIX )] = array( new atkp_compatibility_asa1( array() ), 'compatibilitymode_configuration_page' ); } if(atkp_options::$loader->get_asa2_module_enabled()) { $atkp_compatibility::$modes[__( 'Amazon Simple Affiliate 2', ATKP_PLUGIN_PREFIX )] = array( new atkp_compatibility_asa2( array() ), 'compatibilitymode_configuration_page' ); } } $temptools = array(); if(atkp_options::$loader->get_debug_module_enabled()) { $temptools[__( 'Debug', ATKP_PLUGIN_PREFIX )] = array( new atkp_tools_debug( array() ), 'debug_configuration_page' ); } if(count($temptools) > 0) { $atkp_tools = new atkp_tools( array() ); $atkp_tools::$tools = $temptools; } new atkp_posttypes_shop( array() ); new atkp_posttypes_product( array() ); new atkp_posttypes_list( array() ); if ( atkp_options::$loader->get_shortcodegenerator_module_enabled() || atkp_options::$loader->get_gutenberg_module_enabled() ) { new atkp_shortcode_generator2( array() ); } add_action( 'admin_enqueue_scripts', 'my_affiliate_toolkit_admin_styles' ); } else { new atkp_posttypes_product( array() ); add_action( 'wp_enqueue_scripts', 'my_affiliate_toolkit_styles' ); //enable shortcodes at widget area //add_filter('widget_text', 'do_shortcode'); } //shortcodes für diverse backend editoren immer erzeugen.. new atkp_shortcodes_product( array() ); new atkp_shortcodes_list( array() ); if(atkp_options::$loader->get_asa1_module_enabled()) { new atkp_shortcodes_asa1( array() ); } if(atkp_options::$loader->get_asa2_module_enabled()) { new atkp_shortcodes_asa2( array() ); } new atkp_external_featuredimage(); new atkp_cronjob( array() ); } if(atkp_options::$loader->get_gutenberg_module_enabled()) { new atkp_gutenberg_editor( array() ); } new atkp_endpoints( array() ); function my_affiliate_toolkit_admin_styles( $hook ) { $fontawesome = false; $codemirror = false; if ('post.php' == $hook || 'post-new.php' == $hook || 'plugins.php' == $hook || 'toplevel_page_ATKP_affiliate_toolkit-plugin' == $hook || 'affiliate-toolkit_page_ATKP_affiliate_toolkit-compatibility' == $hook || 'affiliate-toolkit_page_ATKP_affiliate_toolkit-tools' == $hook || 'affiliate-toolkit_page_ATKP_affiliate_toolkit-welcome' == $hook || 'atkp_product_page_atkp_bulkimport' == $hook ) { wp_register_style( 'atkp-styles', plugins_url( '/css/admin-style.css', __FILE__ ) ); wp_enqueue_style( 'atkp-styles' ); if ( $hook == 'toplevel_page_ATKP_affiliate_toolkit-plugin' ) { $fontawesome = true; } } if ( 'post.php' == $hook || 'post-new.php' == $hook ) { wp_register_style( 'atkp-styles', plugins_url( '/css/style.css', __FILE__ ) ); wp_enqueue_style( 'atkp-styles' ); $fontawesome = true; } if($fontawesome) { wp_register_style( 'atkp-fontawesome', plugins_url( '/lib/font-awesome/css/font-awesome.min.css', __FILE__ ) ); wp_enqueue_style( 'atkp-fontawesome' ); } $disable_select2 = ATKPTools::get_setting( ATKP_PLUGIN_PREFIX . '_disableselect2', false ); if ( ! $disable_select2 ) { wp_register_style( 'atkp-select2-styles', plugins_url( '/lib/select2/css/select2.min.css', __FILE__ ) ); wp_enqueue_style( 'atkp-select2-styles' ); wp_register_script( 'atkp-select2-scripts', plugins_url( '/lib/select2/js/select2.min.js', __FILE__ ) ); wp_enqueue_script( 'atkp-select2-scripts' ); } } function my_affiliate_toolkit_styles() { if ( ! ATKPSettings::$disablestyles ) { wp_register_style( 'atkp-styles', plugins_url( '/css/style.css', __FILE__ ) ); $custom_styleurl = ATKPTools::get_global_style_url(); if($custom_styleurl == null) { ATKPTools::add_global_styles( 'atkp-styles' ); } wp_enqueue_style( 'atkp-styles' ); if($custom_styleurl != null) { wp_register_style( 'atkp-styles-custom', $custom_styleurl ); wp_enqueue_style( 'atkp-styles-custom' ); } } $disable_frontend_select2 = ATKPTools::get_setting( ATKP_PLUGIN_PREFIX . '_disablefrontendselect2', false ); if ( ! $disable_frontend_select2 ) { wp_register_style( 'atkp-select2-styles', plugins_url( '/lib/select2/css/select2.min.css', __FILE__ ) ); wp_enqueue_style( 'atkp-select2-styles' ); wp_register_script( 'atkp-select2-scripts', plugins_url( '/lib/select2/js/select2.min.js', __FILE__ ) ); wp_enqueue_script( 'atkp-select2-scripts' ); } wp_register_script( 'atkp-scripts', plugins_url( '/js/library.js', __FILE__ ) ); $custom_scripturl = ATKPTools::get_global_script_url(); if($custom_scripturl == null) { ATKPTools::add_global_scripts( 'atkp-scripts' ); } wp_enqueue_script( 'atkp-scripts' ); if($custom_scripturl != null) { wp_register_script( 'atkp-scripts-custom', $custom_scripturl ); wp_enqueue_script( 'atkp-scripts-custom' ); } } define( 'ATKP_INIT', '1' ); ?>