1 <?php
2
3 4 5 6 7 8 9
10
11
12
13 14 15 16 17
18
19 function vanilla_config_cleanup_head () {
20
21
22
23 if ( is_admin() ) {
24 return;
25 }
26
27
28
29 remove_action( 'wp_head', 'rel_canonical' );
30 remove_action( 'wp_head', 'rsd_link' );
31 remove_action( 'wp_head', 'feed_links', 2 );
32 remove_action( 'wp_head', 'feed_links_extra', 3 );
33 remove_action( 'wp_head', 'wp_shortlink_wp_head' );
34 remove_action( 'wp_head', 'wlwmanifest_link' );
35 remove_action( 'wp_head', 'wp_generator' );
36 remove_action( 'wp_head', 'index_rel_link' );
37 remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );
38 remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );
39 remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 );
40
41 }
42
43
44
45 46 47 48 49 50
51
52 function vanilla_config_no_texturize () {
53
54
55
56 if ( is_admin() ) {
57 return;
58 }
59
60
61
62 remove_filter( 'the_content', 'wptexturize' );
63 remove_filter( 'the_title', 'wptexturize' );
64 remove_filter( 'the_excerpt', 'wptexturize' );
65 remove_filter( 'comment_text', 'wptexturize' );
66
67 }
68
69
70
71 72 73 74 75 76
77
78 function vanilla_config_no_emojis () {
79
80
81
82 if ( is_admin() ) {
83 return;
84 }
85
86
87
88 remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
89 remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
90 remove_action( 'wp_print_styles', 'print_emoji_styles' );
91 remove_action( 'admin_print_styles', 'print_emoji_styles' );
92 remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
93 remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
94 remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
95
96 }
97
98
99
100 101 102 103 104
105
106 function vanilla_config_setup_theme_support () {
107
108
109
110 add_theme_support(
111 'html5',
112 array(
113 'comment-list',
114 'comment-form',
115 'search-form',
116 'gallery',
117 'caption'
118 )
119 );
120
121
122
123 add_theme_support( 'post-thumbnails' );
124
125
126
127 add_post_type_support( 'page', array( 'excerpt' ) );
128
129 }
130
131
132
133 134 135 136 137 138
139
140 function vanilla_config_jpeg_quality () {
141
142 if ( defined( 'VANILLA_JPEG_QUALITY' ) ) {
143 return VANILLA_JPEG_QUALITY;
144 } else {
145 return 75;
146 }
147
148 }
149
150
151
152 153 154 155 156 157
158
159 function vanilla_config_excerpt_length () {
160
161 if ( defined( 'VANILLA_EXCERPT_LENGTH' ) ) {
162 return VANILLA_EXCERPT_LENGTH;
163 } else {
164 return 25;
165 }
166
167 }
168
169
170
171 172 173 174 175 176
177
178 function vanilla_config_excerpt_more () {
179
180 if ( defined( 'VANILLA_EXCERPT_MORE' ) ) {
181 return VANILLA_EXCERPT_MORE;
182 } else {
183 return '…';
184 }
185
186 }
187
188
189
190 191 192 193 194 195 196 197 198
199
200 function vanilla_config_die_handler ( $message, $title = 'Die, dying, dead', $arguments = array() ) {
201
202
203
204 if ( strpos( $_SERVER['REQUEST_URI'], '/wp-admin/' ) !== false && ! is_user_logged_in() ) {
205
206
207
208 $message .= '
209 </p>
210 <p>
211 If you cannot remember your login page url,
212 then you should ask the Nevma team.
213 They will tell you, but it's a secret between you and them!
214 </p>
215 <p>
216 <strong>Hint:</strong>
217 It is the page where the <em>“user logs in”</em>…
218 Get it?
219 ';
220
221 }
222
223 nocache_headers();
224
225
226
227
228
229 include( locate_template( array( 'inc/vanilla/base/vanilla-error.php' ), false, false ) );
230
231 die();
232
233 }
234
235
236
237 238 239 240 241
242
243 function vanilla_config_return_die_handler_name () {
244
245 return 'vanilla_config_die_handler';
246
247 }
248
249 ?>