| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Ultimate Dashboard |
| 4 |
* Plugin URI: http://www.mapsteps.com/en/downloads/ |
| 5 |
* Description: Ultimate Dashboard for WordPress |
| 6 |
* Version: 1.2 |
| 7 |
* Author: MapSteps |
| 8 |
* Author URI: http://www.mapsteps.com/ |
| 9 |
* Text Domain: ultimatedashboard |
| 10 |
*/ |
| 11 |
|
| 12 |
// |
| 13 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 14 |
|
| 15 |
// Plugin constants |
| 16 |
define( 'ULTIMATE_DASHBOARD_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
| 17 |
define( 'ULTIMATE_DASHBOARD_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
| 18 |
|
| 19 |
// Textdomain |
| 20 |
add_action( 'plugins_loaded', 'ultimate_dashboard_textdomain' ); |
| 21 |
function ultimate_dashboard_textdomain() { |
| 22 |
load_plugin_textdomain( 'ultimatedashboard', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' ); |
| 23 |
} |
| 24 |
|
| 25 |
// Enqueue Scripts |
| 26 |
add_action( 'admin_enqueue_scripts', 'ultimate_dashboard_admin_scripts' ); |
| 27 |
function ultimate_dashboard_admin_scripts() { |
| 28 |
global $pagenow, $typenow; |
| 29 |
|
| 30 |
if( ($pagenow == 'post.php' || $pagenow == 'post-new.php') && $typenow == 'udb_widgets') { |
| 31 |
|
| 32 |
wp_register_style( 'font-awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css', false, '1.0.0' ); |
| 33 |
wp_enqueue_style( 'font-awesome' ); |
| 34 |
|
| 35 |
wp_register_style( 'ultimate-dashboard-cpt', ULTIMATE_DASHBOARD_PLUGIN_URL . 'admin/css/ultimate-dashboard-cpt.css', false, '1.0.0' ); |
| 36 |
wp_enqueue_style( 'ultimate-dashboard-cpt' ); |
| 37 |
|
| 38 |
wp_register_script( 'ultimate-dashboard', ULTIMATE_DASHBOARD_PLUGIN_URL . 'admin/js/ultimate-dashboard.js', array('jquery'), '', true ); |
| 39 |
wp_enqueue_script( 'ultimate-dashboard' ); |
| 40 |
} |
| 41 |
|
| 42 |
if ($pagenow == 'edit.php' && $typenow == 'udb_widgets') { |
| 43 |
|
| 44 |
wp_register_style( 'font-awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css', false, '1.0.0' ); |
| 45 |
wp_enqueue_style( 'font-awesome' ); |
| 46 |
?> |
| 47 |
<style type="text/css"> |
| 48 |
td.icon, th#icon { |
| 49 |
text-align: center; |
| 50 |
} |
| 51 |
td.icon .dashicons { |
| 52 |
font-size: 22px; |
| 53 |
} |
| 54 |
td.icon .fa { |
| 55 |
font-size: 18px; |
| 56 |
} |
| 57 |
</style> |
| 58 |
<?php |
| 59 |
} |
| 60 |
|
| 61 |
if( $pagenow == 'index.php' ) { |
| 62 |
|
| 63 |
wp_register_style( 'font-awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css', false, '1.0.0' ); |
| 64 |
wp_enqueue_style( 'font-awesome' ); |
| 65 |
|
| 66 |
wp_register_style( 'roboto', 'https://fonts.googleapis.com/css?family=Roboto', false, '1.0.0' ); |
| 67 |
wp_enqueue_style( 'roboto' ); |
| 68 |
|
| 69 |
wp_register_style( 'ultimate-dashboard-index', ULTIMATE_DASHBOARD_PLUGIN_URL . 'admin/css/ultimate-dashboard.css', false, '1.0.0' ); |
| 70 |
wp_enqueue_style( 'ultimate-dashboard-index' ); |
| 71 |
|
| 72 |
} |
| 73 |
} |
| 74 |
|
| 75 |
// Required Files |
| 76 |
require_once ULTIMATE_DASHBOARD_PLUGIN_DIR . 'admin/ultimate-dashboard-admin.php'; |
| 77 |
require_once ULTIMATE_DASHBOARD_PLUGIN_DIR . 'admin/ultimate-dashboard-fields.php'; |
| 78 |
|
| 79 |
|
| 80 |
?> |