WordPress.org

Make WordPress Core

Ticket #23692: 23692.patch

File 23692.patch, 2.1 KB (added by juliobox, 5 years ago)

My patch :)

  • general-template.php

     
    20872087 * @param array $args Optional arguments.
    20882088 */
    20892089function feed_links( $args = array() ) {
    2090         if ( !current_theme_supports('automatic-feed-links') )
     2090        if ( ! current_theme_supports( 'automatic-feed-links' ) ) {
    20912091                return;
     2092        }
    20922093
    20932094        $defaults = array(
    20942095                /* translators: Separator between blog name and feed type in feed links */
    2095                 'separator'     => _x('»', 'feed link'),
     2096                'separator'     => _x( '»', 'feed link' ),
    20962097                /* translators: 1: blog title, 2: separator (raquo) */
    2097                 'feedtitle'     => __('%1$s %2$s Feed'),
     2098                'feedtitle'     => __( '%1$s %2$s Feed' ),
    20982099                /* translators: 1: blog title, 2: separator (raquo) */
    2099                 'comstitle'     => __('%1$s %2$s Comments Feed'),
     2100                'comstitle'     => __( '%1$s %2$s Comments Feed' ),
    21002101        );
    21012102
    21022103        $args = wp_parse_args( $args, $defaults );
    21032104
    2104         echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr( sprintf( $args['feedtitle'], get_bloginfo('name'), $args['separator'] ) ) . '" href="' . esc_url( get_feed_link() ) . "\" />\n";
    2105         echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr( sprintf( $args['comstitle'], get_bloginfo('name'), $args['separator'] ) ) . '" href="' . esc_url( get_feed_link( 'comments_' . get_default_feed() ) ) . "\" />\n";
     2105        $feed_and_coms = apply_filters( 'feed_links_types', array( 'posts' => true, 'comments' => true ) );
     2106
     2107        if( isset( $feed_and_coms['posts'] ) && (bool) $feed_and_coms['posts'] ) {
     2108                echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr( sprintf( $args['feedtitle'], get_bloginfo( 'name' ), $args['separator'] ) ) . '" href="' . get_feed_link() . "\" />\n";
     2109        }
     2110
     2111        if( isset( $feed_and_coms['comments'] ) && (bool) $feed_and_coms['comments'] ) {
     2112                echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr( sprintf( $args['comstitle'], get_bloginfo( 'name' ), $args['separator'] ) ) . '" href="' . get_feed_link( 'comments_' . get_default_feed() ) . "\" />\n";
     2113        }
    21062114}
    21072115
    21082116/**