[wp-meta] [Making WordPress.org] #3309: Feed shows posts while in 'Coming soon' mode
Making WordPress.org
noreply at wordpress.org
Mon Dec 4 21:03:15 UTC 2017
#3309: Feed shows posts while in 'Coming soon' mode
-------------------------------------+------------------
Reporter: casiepa | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: WordCamp Site & Plugins | Resolution:
Keywords: |
-------------------------------------+------------------
Comment (by casiepa):
@RMarks ok, thanks for the update.
I suppose something like this could somewhere be added when going into
Coming Soon mode:
{{{
add_action( 'init', 'coming_soon_remove_feeds', 99 );
function coming_soon_remove_feeds() {
// Disable all feeds
foreach( array( '', '_rdf', '_rss', '_rss2', '_atom',
'_rss2_comments', '_atom_comments' ) as $feed ) {
add_action( 'do_feed' . $feed,
'coming_soon_remove_feeds_error', 1);
}
// Show message
function coming_soon_remove_feeds_error() {
wp_die( __( 'Feeds are not available while the site is in
Coming Soon mode.', 'wordcamporg' ),
'Coming Soon mode ON',
403
);
}
// Remove <link rel="alternate" type="application/rss+xml"
title="WordCamp » Feed" href="https://2018.xyz.wordcamp.org/feed/"
/>
remove_action( 'wp_head', 'feed_links', 2 );
// Remove <link rel="alternate" type="application/rss+xml"
title="WordCamp » Comments Feed"
href="https://2018.xyz.wordcamp.org/comments/feed/" />
remove_action( 'wp_head', 'feed_links_extra', 3 );
// ??? It might be needed to flush the rewrite rules :
flush_rewrite_rules();
}
}}}
--
Ticket URL: <https://meta.trac.wordpress.org/ticket/3309#comment:4>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org
More information about the wp-meta
mailing list