Make WordPress Core


Ignore:
Timestamp:
02/24/2016 02:35:23 AM (9 years ago)
Author:
jorbin
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/general-template.php

    r36620 r36671  
    25362536        /* translators: 1: blog name, 2: separator(raquo), 3: tag name */
    25372537        'tagtitle'    => __('%1$s %2$s %3$s Tag Feed'),
     2538        /* translators: 1: blog name, 2: separator(raquo), 3: term name, 4: taxonomy singular name */
     2539        'taxtitle'    => __('%1$s %2$s %3$s %4$s Feed'),
    25382540        /* translators: 1: blog name, 2: separator(raquo), 3: author name  */
    25392541        'authortitle' => __('%1$s %2$s Posts by %3$s Feed'),
     
    25762578            $href = get_tag_feed_link( $term->term_id );
    25772579        }
     2580    } elseif ( is_tax() ) {
     2581        $term = get_queried_object();
     2582        $tax = get_taxonomy( $term->taxonomy );
     2583        $title = sprintf( $args['taxtitle'], get_bloginfo('name'), $args['separator'], $term->name, $tax->labels->singular_name );
     2584        $href = get_term_feed_link( $term->term_id, $term->taxonomy );
    25782585    } elseif ( is_author() ) {
    25792586        $author_id = intval( get_query_var('author') );
Note: See TracChangeset for help on using the changeset viewer.