This repository has been archived by the owner on Jan 23, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
capitan.php
58 lines (47 loc) · 2.02 KB
/
capitan.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
<?php
/*
Plugin Name: Capitan for Wordpress
Plugin URI: https://github.com/pgharts/capitan-wordpress
Description: Festival and Event management.
Version: 0.1
Author: The Pittsburgh Cultural Trust
Author URI: https://github.com/pgharts/
License: GPL3
*/
/* Copyright 2013 The Pittsburgh Cultural Trust (email : [email protected])
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 3, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
new Capitan();
class Capitan {
// set up the initialization hooks for the plugin
function __construct() {
require_once "lib/capitan_autoloader.php";
require_once 'lib/capitan_shortcode.php';
require_once 'lib/capitan_ajax.php';
add_action('admin_menu', array('CapitanAdmin', 'addCapitanAdminMenu'));
add_action('admin_init', array('CapitanAdmin', 'registerCapitanSettings'));
add_action('init', array(__CLASS__, 'enqueueStylesAndScripts'));
add_action('wp_enqueue_scripts', array(__CLASS__, 'enqueueJavascripts'));
add_action( 'widgets_init', create_function( '', 'register_widget( "Capitan_Calendar_Widget" );' ) );
}
function enqueueJavascripts() {
wp_enqueue_script('jquery');
wp_enqueue_script('capitan_widget', plugins_url('/capitan/lib/js/calendar_widget.js') );
}
function enqueueStylesAndScripts() {
add_action('wp_print_styles', array(__CLASS__, 'enqueueCSS'));
}
public static function enqueueCSS() {
wp_enqueue_style('capitanStyle', plugins_url( "/capitan/lib/css/capitan.css"));
}
}
?>