From e4dc3d123230304a427c8956df6091faacefed00 Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Wed, 24 Feb 2016 02:36:25 +0000 Subject: [PATCH] Make Custom Taxonomy Feeds Auto-discoverable This helps improve the parity between custom taxonomies and built in taxonomies. It is one small step to #makeCustomTaxonomyFeedsGreatAgain. Fixes #23677 Props mdgl, stevenkword Built from https://develop.svn.wordpress.org/trunk@36671 git-svn-id: http://core.svn.wordpress.org/trunk@36638 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/general-template.php | 7 +++++++ wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 358412f968..e6a6498876 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -2535,6 +2535,8 @@ function feed_links_extra( $args = array() ) { 'cattitle' => __('%1$s %2$s %3$s Category Feed'), /* translators: 1: blog name, 2: separator(raquo), 3: tag name */ 'tagtitle' => __('%1$s %2$s %3$s Tag Feed'), + /* translators: 1: blog name, 2: separator(raquo), 3: term name, 4: taxonomy singular name */ + 'taxtitle' => __('%1$s %2$s %3$s %4$s Feed'), /* translators: 1: blog name, 2: separator(raquo), 3: author name */ 'authortitle' => __('%1$s %2$s Posts by %3$s Feed'), /* translators: 1: blog name, 2: separator(raquo), 3: search phrase */ @@ -2575,6 +2577,11 @@ function feed_links_extra( $args = array() ) { $title = sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $term->name ); $href = get_tag_feed_link( $term->term_id ); } + } elseif ( is_tax() ) { + $term = get_queried_object(); + $tax = get_taxonomy( $term->taxonomy ); + $title = sprintf( $args['taxtitle'], get_bloginfo('name'), $args['separator'], $term->name, $tax->labels->singular_name ); + $href = get_term_feed_link( $term->term_id, $term->taxonomy ); } elseif ( is_author() ) { $author_id = intval( get_query_var('author') ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 5b0212d5ac..707e537cf0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-alpha-36670'; +$wp_version = '4.5-alpha-36671'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.