-
Notifications
You must be signed in to change notification settings - Fork 0
/
coffeepress.php
47 lines (39 loc) · 1.35 KB
/
coffeepress.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* Plugin Name: Coffee Press
* Plugin URI: http://donini.me/
* Description: A few tips for the WordPress developers
* Author: Rodrigo Donini
* Author URI: http://donini.me/
* Text Domain: coffeepress
* Domain Path: /languages
* Version: 1.2
*
* @package CoffeePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
define( 'COFFEEPRESS_PATH', plugin_dir_path( __FILE__ ) );
require_once COFFEEPRESS_PATH . 'inc/class-cp-helper.php';
require_once COFFEEPRESS_PATH . 'inc/class-cp-column.php';
require_once COFFEEPRESS_PATH . 'inc/class-cp-message.php';
require_once COFFEEPRESS_PATH . 'inc/class-cp-bulk-action.php';
/**
* Test if the ACF plugin is active.
*/
function activation_check() {
if ( ! is_plugin_active( 'advanced-custom-fields-pro/acf.php' ) ) {
deactivate_plugins( plugin_basename( __FILE__ ) );
wp_die( 'The plugin ACF needs to be installed and active in order to activate this plugin.' );
}
}
/**
* Load the plugins assets.
*/
function load_assets() {
wp_enqueue_script( 'cp-js-message', plugin_dir_url( __FILE__ ) . 'assets/js/message.js', array( 'jquery' ), true, true );
wp_enqueue_style( 'cp-css-message', plugin_dir_url( __FILE__ ) . 'assets/css/message.css' );
}
register_activation_hook( __FILE__, 'activation_check' );
add_action( 'wp_enqueue_scripts', 'load_assets' );