-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
164 lines (105 loc) · 4.23 KB
/
functions.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<?php
define('INCLUDED', TRUE);
include_once('dBug.php');
// Load official GoCardless library
include_once('GoCardless/init.php');
foreach ( glob( __DIR__ . '/functions/*.php') as $filename )
{ include_once($filename); }
foreach ( glob( __DIR__ . '/classes/*.php') as $filename )
{ include_once($filename); }
foreach ( glob( __DIR__ . '/listTables/*.php') as $filename )
{ include_once($filename); }
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 400, 400 );
add_filter('show_admin_bar', '__return_false');
add_filter('wp_mail_content_type',create_function('', 'return "text/html"; '));
function style_bisons_editor() {
$font_url = str_replace( ',', '%2C', '//fonts.googleapis.com/css?family=Ubuntu:300,400,300italic,400italic:latin' );
add_editor_style( $font_url );
add_editor_style( 'stylesheets/style-editor.css' );
}
add_action( 'after_setup_theme', 'style_bisons_editor' );
include_once( __DIR__ . '/wp-cron/activateSchedules.php');
foreach ( glob( __DIR__ . '/init/*.php') as $filename )
{ include_once($filename); }
if ( is_admin() ) {
include_once( __DIR__ . '/settings_api/fieldCallbacks.php');
foreach ( glob( __DIR__ . '/settings_api/pages/*.php') as $filename )
{ include_once($filename); }
foreach ( glob( __DIR__ . '/admin_menus/*.php') as $filename )
{ include_once($filename); }
foreach ( glob( __DIR__ . '/admin_submenus/*.php') as $filename )
{ include_once($filename); }
}
foreach ( glob( __DIR__ . '/wp-cron/schedules/*.php') as $filename )
{ include_once($filename); }
foreach ( glob( __DIR__ . '/wp-cron/actions/*.php') as $filename )
{ include_once($filename); }
// Get flash message from querystring if there is one
if (isset ( $_GET['nonce'] ) )
{
if ( wp_verify_nonce ( $_GET['nonce'], 'bisons_flashmessage_nonce') )
$GLOBALS['bisons_flash_message'] = stripslashes ( $_GET['flash'] );
}
// Dependencies
include_once('Mandrill/Mandrill.php');
$mandrill = new Mandrill('ZzbBwttWRHJ41GL4BZmmsQ');
// Feeds
include_once('feeds/ical-all.php');
include_once('init/excerpt.php');
// Email handling
include_once('PHPMailer/PHPMailerAutoload.php');
include_once('email/send_bison_mail.php');
// Custom shortcodes
include_once('shortcodes/feestable.php');
include_once('shortcodes/contactform.php');
include_once('shortcodes/supporterjoin.php');
// My blog settings
include_once('init/settings.php');
// API wrappers which provide the Facebook and Twitter widget feeds
include_once('API_Wrapper/twitter.php');
include_once('API_Wrapper/facebook.php');
include_once('API_Wrapper/flikr.php');
// Custom widgets built into this theme
include_once('widgets/nextmatch.php');
include_once('widgets/twitter.php');
include_once('widgets/facebook.php');
include_once('widgets/welcometext.php');
// Form handlers
if (isset ( $_POST['nonce'] ) )
{
if ( wp_verify_nonce( $_POST['nonce'], 'wordpress_form_submit' ) && file_exists ( __DIR__ . '/form_handlers/' . $_POST['wp_form_id'] . '.php' ) )
include_once('form_handlers/' . $_POST['wp_form_id']. '.php');
}
include_once('listTables/membership_forms.php');
if (isset ( $_POST['action'] ) || isset($_POST['action2']) )
{
if ( strpos($_POST['action'], 'set_season_') !== false) {
$season = explode('set_season_', $_POST['action'])[1];
include_once ('list_table_bulk_actions/set_season_as.php' );
}
elseif ( strpos($_POST['action2'], 'set_season_') !== false) {
$season = explode('set_season_', $_POST['action2'])[1];
include_once ('list_table_bulk_actions/set_season_as.php' );
}
elseif ( file_exists( __DIR__ . '/list_table_bulk_actions/' . $_POST['action'] . '.php' ) && $_POST['action'] != '-1' ) {
include_once ('list_table_bulk_actions/' . $_POST['action'] . '.php' );
}
elseif ( file_exists( __DIR__ . '/list_table_bulk_actions/' . $_POST['action2'] . '.php' ) && $_POST['action2'] != '-1' ) {
include_once ('list_table_bulk_actions/' . $_POST['action2'] . '.php' );
}
}
// Fix 'insert to post' button not visible bug.
add_filter( 'get_media_item_args', 'force_send' );
function force_send($args){
$args['send'] = true;
return $args;
}
if ( current_user_can( 'bisons_debug') && isset ( $_GET['debug'])) {
switch ( $_GET['debug']) {
case "userMeta":
new dBug(get_user_meta(get_current_user_id()));
exit;
break;
}
}