Skip to content
Permalink
Browse files

Remove functionality of RDF feeds #242

  • Loading branch information...
markkap committed Apr 19, 2019
1 parent 5d7970d commit da53175ff8423a735a1c9e59e6279f2bcd26c985
@@ -266,10 +266,10 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
// paging and feeds
if ( get_query_var( 'paged' ) || is_feed() || get_query_var( 'cpage' ) ) {
while ( preg_match( "#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", $redirect['path'] ) || preg_match( '#/(comments/?)?(feed|rss|rdf|atom|rss2)(/+)?$#', $redirect['path'] ) || preg_match( "#/{$wp_rewrite->comments_pagination_base}-[0-9]+(/+)?$#", $redirect['path'] ) ) {
while ( preg_match( "#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", $redirect['path'] ) || preg_match( '#/(comments/?)?(feed|rss|atom|rss2)(/+)?$#', $redirect['path'] ) || preg_match( "#/{$wp_rewrite->comments_pagination_base}-[0-9]+(/+)?$#", $redirect['path'] ) ) {
// Strip off paging and feed
$redirect['path'] = preg_replace( "#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", '/', $redirect['path'] ); // strip off any existing paging
$redirect['path'] = preg_replace( '#/(comments/?)?(feed|rss2?|rdf|atom)(/+|$)#', '/', $redirect['path'] ); // strip off feed endings
$redirect['path'] = preg_replace( '#/(comments/?)?(feed|rss2?|atom)(/+|$)#', '/', $redirect['path'] ); // strip off feed endings
$redirect['path'] = preg_replace( "#/{$wp_rewrite->comments_pagination_base}-[0-9]+?(/+)?$#", '/', $redirect['path'] ); // strip off any existing comment paging
}
@@ -290,7 +290,6 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
'wp-atom.php' => 'atom',
'wp-commentsrss2.php' => 'comments_rss2',
'wp-feed.php' => get_default_feed(),
'wp-rdf.php' => 'rdf',
'wp-rss.php' => 'rss2',
'wp-rss2.php' => 'rss2',
);
@@ -327,7 +327,7 @@ class WP_Rewrite {
* @since 1.5.0
* @var array
*/
public $feeds = array( 'feed', 'rdf', 'rss', 'rss2', 'atom' );
public $feeds = array( 'feed', 'rss', 'rss2', 'atom' );
/**
* Determines whether permalinks are being used.
@@ -962,11 +962,11 @@ public function generate_rewrite_rules( $permalink_structure, $ep_mask = EP_NONE
$rootcommentquery = $index . '?' . $query . '&page_id=' . get_option( 'page_on_front' ) . '&cpage=' . $this->preg_index( $num_toks + 1 );
}
// Create query for /feed/(feed|atom|rss|rss2|rdf).
// Create query for /feed/(feed|atom|rss|rss2).
$feedmatch = $match . $feedregex;
$feedquery = $feedindex . '?' . $query . '&feed=' . $this->preg_index( $num_toks + 1 );
// Create query for /(feed|atom|rss|rss2|rdf) (see comment near creation of $feedregex).
// Create query for /(feed|atom|rss|rss2) (see comment near creation of $feedregex).
$feedmatch2 = $match . $feedregex2;
$feedquery2 = $feedindex . '?' . $query . '&feed=' . $this->preg_index( $num_toks + 1 );
@@ -1219,7 +1219,7 @@ public function rewrite_rules() {
// Old feed and service files.
$deprecated_files = array(
'.*wp-(atom|rdf|rss|rss2|feed|commentsrss2)\.php$' => $this->index . '?feed=old',
'.*wp-(atom|rss|rss2|feed|commentsrss2)\.php$' => $this->index . '?feed=old',
'.*wp-app\.php(/.*)?$' => $this->index . '?error=403',
);
@@ -281,7 +281,6 @@
}
// 2 Actions 2 Furious
add_action( 'do_feed_rdf', 'do_feed_rdf', 10, 1 );
add_action( 'do_feed_rss', 'do_feed_rss', 10, 1 );
add_action( 'do_feed_rss2', 'do_feed_rss2', 10, 1 );
add_action( 'do_feed_atom', 'do_feed_atom', 10, 1 );

This file was deleted.

@@ -16,7 +16,7 @@
* @since 4.0.0
*
* @param string $context Type of feed. Possible values include 'rss2', 'rss2-comments',
* 'rdf', 'atom', and 'atom-comments'.
* 'atom', and 'atom-comments'.
*/
do_action( 'rss_tag_pre', 'rss2' );
?>
@@ -168,7 +168,7 @@ function the_title_rss() {
* @since 2.9.0
* @see get_the_content()
*
* @param string $feed_type The type of feed. rss2 | atom | rss | rdf
* @param string $feed_type The type of feed. rss2 | atom | rss
* @return string The filtered content.
*/
function get_the_content_feed( $feed_type = null ) {
@@ -196,7 +196,7 @@ function get_the_content_feed( $feed_type = null ) {
*
* @since 2.9.0
*
* @param string $feed_type The type of feed. rss2 | atom | rss | rdf
* @param string $feed_type The type of feed. rss2 | atom | rss
*/
function the_content_feed( $feed_type = null ) {
echo get_the_content_feed( $feed_type );
@@ -355,7 +355,7 @@ function comment_text_rss() {
*
* All of the categories for the current post in the feed loop, will be
* retrieved and have feed markup added, so that they can easily be added to the
* RSS2, Atom, or RSS1 and RSS0.91 RDF feeds.
* RSS2, Atom, or RSS1 feeds.
*
* @since 2.1.0
*
@@ -391,9 +391,7 @@ function get_the_category_rss( $type = null ) {
$cat_names = array_unique( $cat_names );
foreach ( $cat_names as $cat_name ) {
if ( 'rdf' == $type ) {
$the_list .= "\t\t<dc:subject><![CDATA[$cat_name]]></dc:subject>\n";
} elseif ( 'atom' == $type ) {
if ( 'atom' == $type ) {
$the_list .= sprintf( '<category scheme="%1$s" term="%2$s" />', esc_attr( get_bloginfo_rss( 'url' ) ), esc_attr( $cat_name ) );
} else {
$the_list .= "\t\t<category><![CDATA[" . @html_entity_decode( $cat_name, ENT_COMPAT, get_option( 'blog_charset' ) ) . "]]></category>\n";
@@ -625,7 +623,7 @@ function self_link() {
*
* @since 2.8.0
*
* @param string $type Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'.
* @param string $type Type of feed. Possible values include 'rss', rss2' and 'atom'.
*/
function feed_content_type( $type = '' ) {
if ( empty( $type ) ) {
@@ -637,7 +635,6 @@ function feed_content_type( $type = '' ) {
'rss2' => 'application/rss+xml',
'rss-http' => 'text/xml',
'atom' => 'application/atom+xml',
'rdf' => 'application/rdf+xml',
);
$content_type = ( ! empty( $types[ $type ] ) ) ? $types[ $type ] : 'application/octet-stream';
@@ -648,7 +645,7 @@ function feed_content_type( $type = '' ) {
* @since 2.8.0
*
* @param string $content_type Content type indicating the type of data that a feed contains.
* @param string $type Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'.
* @param string $type Type of feed. Possible values include 'rss', rss2', and 'atom'.
*/
return apply_filters( 'feed_content_type', $content_type, $type );
}
@@ -1379,7 +1379,7 @@ function do_feed() {
* Fires once the given feed is loaded.
*
* The dynamic portion of the hook name, `$feed`, refers to the feed template name.
* Possible values include: 'rdf', 'rss', 'rss2', and 'atom'.
* Possible values include: 'rss', 'rss2', and 'atom'.
*
* @since 2.1.0
* @since 4.4.0 The `$feed` parameter was added.
@@ -1390,17 +1390,6 @@ function do_feed() {
do_action( "do_feed_{$feed}", $wp_query->is_comment_feed, $feed );
}
/**
* Load the RDF RSS 0.91 Feed template.
*
* @since 2.1.0
*
* @see load_template()
*/
function do_feed_rdf() {
load_template( ABSPATH . WPINC . '/feed-rdf.php' );
}
/**
* Load the RSS 1.0 Feed Template.
*
@@ -617,7 +617,7 @@ function bloginfo( $show = '' ) {
* - 'template_url' / 'template_directory' - URL of the active theme's directory. An active
* child theme will NOT take precedence over this value
* - 'atom_url' - The Atom feed URL (/feed/atom)
* - 'rdf_url' - The RDF/RSS 1.0 feed URL (/feed/rdf)
* - 'rdf_url' - Deprecated in calmPress, returns the rss2 feed for backward compatibility.
* - 'rss_url' - The RSS 0.92 feed URL (/feed/rss)
* - 'rss2_url' - The RSS 2.0 feed URL (/feed)
* - 'comments_atom_url' - The comments Atom feed URL (/comments/feed)
@@ -641,12 +641,10 @@ function get_bloginfo( $show = '', $filter = 'raw' ) {
case 'description':
$output = get_option( 'blogdescription' );
break;
case 'rdf_url':
$output = get_feed_link( 'rdf' );
break;
case 'rss_url':
$output = get_feed_link( 'rss' );
break;
case 'rdf_url':
case 'rss2_url':
$output = get_feed_link( 'rss2' );
break;
@@ -3835,7 +3833,7 @@ function add_thickbox() {
*
* @since 2.5.0
*
* @param string $type The type of generator to output - (html|xhtml|atom|rss2|rdf|comment|export).
* @param string $type The type of generator to output - (html|xhtml|atom|rss2|comment|export).
*/
function the_generator( $type ) {
/**

0 comments on commit da53175

Please sign in to comment.
You can’t perform that action at this time.