/** * Admin Scripts * * @access public * @return void */ public function enqueue_admin_script() { global $DC_Woodle; $screen = get_current_screen(); // Enqueue admin script and stylesheet if (in_array($screen->id, array('synchronise_page_dc-woodle-setting-admin', 'toplevel_page_dc-woodle-sync-courses', 'product', 'course'))) { $DC_Woodle->library->load_qtip_lib(); wp_enqueue_script('admin_js', $DC_Woodle->plugin_url . 'assets/admin/js/admin.js', array('jquery'), $DC_Woodle->version, true); wp_enqueue_style('admin_css', $DC_Woodle->plugin_url . 'assets/admin/css/admin.css', array(), $DC_Woodle->version); if (DC_Woodle_Dependencies::wc_active_check()) { $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; $wc_assets_path = str_replace(array('http:', 'https:'), '', WC()->plugin_url()) . '/assets/'; wp_enqueue_script('chosen', $wc_assets_path . 'js/chosen/chosen.jquery' . $suffix . '.js', array('jquery'), '1.0.0'); } } }
<?php /* Plugin Name: MooWoodle Plugin URI: http://dualcube.com Description: The MooWoodle plugin is an extention of WooCommerce that acts as a bridge between WordPress/Woocommerce and Moodle. Author: Dualcube Version: 1.0.0 Author URI: http://dualcube.com */ if (!class_exists('DC_Woodle_Dependencies')) { require_once 'includes/class-dc-woodle-dependencies.php'; } if (!DC_Woodle_Dependencies::wc_active_check()) { add_action('admin_notices', 'woodle_wc_inactive_notice'); } require_once 'includes/dc-woodle-core-functions.php'; require_once 'config.php'; if (!defined('ABSPATH')) { exit; } // Exit if accessed directly if (!defined('DC_WOODLE_PLUGIN_TOKEN')) { exit; } if (!defined('DC_WOODLE_TEXT_DOMAIN')) { exit; } if (!defined('DC_WOODLE_PLUGIN_BASENAME')) { define('DC_WOODLE_PLUGIN_BASENAME', plugin_basename(__FILE__)); }