=')) { require_once plugin_dir_path(__FILE__) . 'includes/class-acowebs-feedback-client.php'; require_once plugin_dir_path(__FILE__) . 'includes/class-acowebs-feedback-optin.php'; // Newsletter notice: WP Dashboard only (no plugin pages listed). Acowebs_Feedback_Optin::register(array( 'plugin' => ACOPLW_FEEDBACK_PLUGIN, 'edition' => ACOPLW_EDITION, 'list' => 'product labels for woocommerce', // Acowebs panel list for this plugin's subscribers. 'slug' => ACOPLW_SLUG, 'page_slugs' => array(), 'prefix' => 'acoplw', 'kit_dir' => plugin_dir_path(__FILE__) . 'assets/acowebs-ui-kit/', 'kit_url' => plugin_dir_url(__FILE__) . 'assets/acowebs-ui-kit/', )); // Align the newsletter card with the other admin notices (same width and spacing). Outer box only: // the wrapper and the kit card each add a 20px right margin, so the card ended short of the others. add_action('admin_enqueue_scripts', function () { if (wp_style_is('acowebs-feedback-ui', 'enqueued')) { wp_add_inline_style( 'acowebs-feedback-ui', '.notice.acowebs-optin-notice{margin:5px 0 15px !important}' . '.acowebs-optin-notice > .acofb.acofb-notice{margin:0}' ); } }, 20); } if ( !function_exists('acoplw_init') ) { function acoplw_init() { $plugin_rel_path = basename(dirname(__FILE__)) . '/languages'; /* Relative to WP_PLUGIN_DIR */ load_plugin_textdomain('aco-product-labels-for-woocommerce', false, $plugin_rel_path); } } if ( !function_exists('acoplw_autoloader') ) { function acoplw_autoloader($class_name) { if ( 0 === strpos($class_name, 'ACOPLW') ) { $classes_dir = realpath(plugin_dir_path(__FILE__)) . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR; $class_file = 'class-' . str_replace('_', '-', strtolower($class_name)) . '.php'; require_once $classes_dir . $class_file; } } } if ( !function_exists('ACOPLW') ) { function ACOPLW() { $instance = ACOPLW_Backend::instance(__FILE__, ACOPLW_VERSION); return $instance; } } add_action('plugins_loaded', 'acoplw_init'); spl_autoload_register('acoplw_autoloader'); if ( is_admin() ) { ACOPLW(); } new ACOPLW_Api(); $badge = new ACOPLW_Badge(); new ACOPLW_Front_End($badge, __FILE__, ACOPLW_VERSION); add_action( 'before_woocommerce_init', function() { if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); } } );