/** * Load Admin Scripts * * Enqueues the required admin scripts. * * @since 1.0 * @global $post * @param string $hook Page hook * @return void */ function mashsb_load_admin_scripts($hook) { if (!apply_filters('mashsb_load_admin_scripts', mashsb_is_admin_page(), $hook)) { return; } global $wp_version; $js_dir = MASHSB_PLUGIN_URL . 'assets/js/'; $css_dir = MASHSB_PLUGIN_URL . 'assets/css/'; // Use minified libraries if SCRIPT_DEBUG is turned off $suffix = mashsbIsDebugMode() ? '' : '.min'; //$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; //echo $css_dir . 'mashsb-admin' . $suffix . '.css', MASHSB_VERSION; // These have to be global wp_enqueue_script('mashsb-admin-scripts', $js_dir . 'mashsb-admin' . $suffix . '.js', array('jquery'), MASHSB_VERSION, false); wp_enqueue_script('jquery-ui-sortable'); wp_enqueue_script('media-upload'); //Provides all the functions needed to upload, validate and give format to files. wp_enqueue_script('thickbox'); //Responsible for managing the modal window. wp_enqueue_style('thickbox'); //Provides the styles needed for this window. wp_enqueue_style('mashsb-admin', $css_dir . 'mashsb-admin' . $suffix . '.css', MASHSB_VERSION); }
/** * Load Admin Scripts * * Enqueues the required admin scripts. * * @since 1.0 * @global $post * @param string $hook Page hook * @return string custom css into */ function mashsb_load_admin_scripts($hook) { if (!apply_filters('mashsb_load_admin_scripts', mashsb_is_admin_page(), $hook)) { return; } global $mashsb_options; $js_dir = MASHSB_PLUGIN_URL . 'assets/js/'; $css_dir = MASHSB_PLUGIN_URL . 'assets/css/'; // Use minified libraries if Mashshare debug mode is turned off $suffix = mashsbIsDebugMode() ? '' : '.min'; wp_enqueue_script('mashsb-admin-scripts', $js_dir . 'mashsb-admin' . $suffix . '.js', array('jquery'), MASHSB_VERSION, false); wp_enqueue_script('jquery-ui-sortable'); wp_enqueue_script('media-upload'); //Provides all the functions needed to upload, validate and give format to files. wp_enqueue_script('thickbox'); //Responsible for managing the modal window. wp_enqueue_style('thickbox'); //Provides the styles needed for this window. wp_enqueue_style('mashsb-admin', $css_dir . 'mashsb-admin' . $suffix . '.css', MASHSB_VERSION); wp_register_style('jquery-chosen', $css_dir . 'chosen' . $suffix . '.css', array(), MASHSB_VERSION); wp_enqueue_style('jquery-chosen'); wp_register_script('jquery-chosen', $js_dir . 'chosen.jquery' . $suffix . '.js', array('jquery'), MASHSB_VERSION); wp_enqueue_script('jquery-chosen'); }