-
Notifications
You must be signed in to change notification settings - Fork 1
/
aboutmagic-plugin.php
executable file
·78 lines (55 loc) · 1.63 KB
/
aboutmagic-plugin.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/*
Plugin Name: AboutMagic-Plugin
Description: AboutMagic plugin for Wordpress
Version: 0.1
Author: Fernando Hidalgo
Author URI: http://sopinet.com
Plugin URI: https://github.com/sopinet/aboutmagic-plugin
*/
/**
* Define some useful constants
**/
define('ABOUTMAGIC_VERSION', '1.0');
define('ABOUTMAGIC_DIR', plugin_dir_path(__FILE__));
define('ABOUTMAGIC_URL', plugin_dir_url(__FILE__));
/**
* Load files
*
**/
function aboutmagicplugin_load(){
if(is_admin()) {
require_once(ABOUTMAGIC_DIR.'includes/admin.php');
}
require_once(ABOUTMAGIC_DIR.'includes/core.php');
}
aboutmagicplugin_load();
add_action('wp_print_scripts', 'aboutmagicplugin_ScriptsAction');
function aboutmagicplugin_ScriptsAction() {
$mosaic_js = ABOUTMAGIC_URL . 'assets/js/mosaic.1.0.1.min.js';
$mosaic_css = ABOUTMAGIC_URL . 'assets/css/mosaic.css';
if (!is_admin())
{
wp_enqueue_script('jquery');
wp_enqueue_script('aboutmagic_script', $mosaic_js);
wp_enqueue_style('aboutmagic_style', $mosaic_css);
}
}
/**
* Activation, Deactivation and Uninstall Functions
*
**/
register_activation_hook(__FILE__, 'aboutmagic_activation');
register_deactivation_hook(__FILE__, 'aboutmagic_deactivation');
function aboutmagicplugin_activation() {
//actions to perform once on plugin activation go here
//register uninstaller
register_uninstall_hook(__FILE__, 'aboutmagicplugin_uninstall');
}
function aboutmagicplugin_deactivation() {
// actions to perform once on plugin deactivation go here
}
function aboutmagicplugin_uninstall(){
//actions to perform once on plugin uninstall go here
}
?>