-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoe.php
103 lines (82 loc) · 3.9 KB
/
coe.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
/**
* Plugin Name: Center of Excellence
* Plugin URI: http://www.coeaerospace.com/
* Description: Custom Plugin for Center of Excellence
* Author: Tony DeStefano
* Author URI: https://www.facebook.com/TonyDeStefanoWeb
* Version: 1.0.0
* Text Domain: coe
*
* Copyright 2016 Tony DeStefano
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2, 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
*
*/
if ( ! defined( 'WPINC' ) )
{
die;
}
require_once ( 'classes/COE/Controller.php' );
require_once ( 'classes/COE/College.php' );
require_once ( 'classes/COE/Program.php' );
require_once ( 'classes/COE/ProgramCategory.php' );
require_once ( 'classes/COE/Award.php' );
/* controller object */
$coe_controller = new \COE\Controller;
/* activate */
register_activation_hook( __FILE__, array( $coe_controller, 'activate' ) );
/* enqueue js and css */
add_action( 'init', array( $coe_controller, 'init' ) );
/* Create custom post types */
add_action( 'init', array( $coe_controller, 'create_post_types' ) );
/* capture form post */
add_action ( 'init', array( $coe_controller, 'form_capture' ) );
/* register shortcode */
add_shortcode ( 'coe', array( $coe_controller, 'short_code' ) );
/* admin stuff */
if ( is_admin() )
{
/* Add main menu and sub-menus */
add_action( 'admin_menu', array( $coe_controller, 'admin_menus') );
/* register settings */
add_action( 'admin_init', array( $coe_controller, 'register_settings' ) );
/* admin scripts */
add_action( 'admin_init', array( $coe_controller, 'admin_scripts' ) );
/* remove the "view" action from the custom post type */
add_filter( 'post_row_actions', array( $coe_controller, 'remove_row_actions' ), 10, 1 );
add_filter('post_updated_messages', array( $coe_controller, 'custom_post_type_messages' ) );
/* add the settings page link */
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $coe_controller, 'settings_link' ) );
/* add the instructions page link */
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $coe_controller, 'instructions_link' ) );
/* add the settings page */
add_action( 'admin_menu', array( $coe_controller, 'settings_page' ) );
/* save post meta */
add_action( 'save_post', array( $coe_controller, 'save_custom_post_meta' ) );
/* college meta and columns */
add_action( 'admin_init', array( $coe_controller, 'college_meta' ) );
add_filter( 'manage_' . \COE\College::POST_TYPE . '_posts_columns', array( $coe_controller, 'add_new_collge_columns' ) );
add_action( 'manage_' . \COE\College::POST_TYPE . '_posts_custom_column' , array( $coe_controller, 'custom_college_columns' ) );
/* award meta and columns */
add_action( 'admin_init', array( $coe_controller, 'award_meta' ) );
add_filter( 'manage_' . \COE\Award::POST_TYPE . '_posts_columns', array( $coe_controller, 'add_new_award_columns' ) );
add_action( 'manage_' . \COE\Award::POST_TYPE . '_posts_custom_column' , array( $coe_controller, 'custom_award_columns' ) );
/* program meta and columns */
add_action( 'admin_init', array( $coe_controller, 'program_meta' ) );
add_filter( 'manage_' . \COE\Program::POST_TYPE . '_posts_columns', array( $coe_controller, 'add_new_program_columns' ) );
add_action( 'manage_' . \COE\Program::POST_TYPE . '_posts_custom_column' , array( $coe_controller, 'custom_program_columns' ) );
/* exports */
add_action( 'init', array( $coe_controller, 'process_exports' ) );
}