-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
29 lines (26 loc) · 820 Bytes
/
functions.php
File metadata and controls
29 lines (26 loc) · 820 Bytes
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
<?php
/**
* No Frontend theme functions.
*
* @package nofrontend
*/
// Remove references to RSS feeds.
remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'feed_links', 2 );
/**
* Responds with an error then dies.
*
* @return void
*/
function nofrontend_disabled() {
wp_die( esc_html( 'Sorry, that is not available.' ), '', [ 'response' => 404 ] );
exit;
}
// Disable RSS feeds.
add_action( 'do_feed', 'nofrontend_disabled', 1 );
add_action( 'do_feed_rdf', 'nofrontend_disabled', 1 );
add_action( 'do_feed_rss', 'nofrontend_disabled', 1 );
add_action( 'do_feed_rss2', 'nofrontend_disabled', 1 );
add_action( 'do_feed_atom', 'nofrontend_disabled', 1 );
add_action( 'do_feed_rss2_comments', 'nofrontend_disabled', 1 );
add_action( 'do_feed_atom_comments', 'nofrontend_disabled', 1 );