mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Add filters to feed_links()
to choose whether to display the links to posts feed and comments feed, separately.
props joostdevalk, juliobox. fixes #23692. Built from https://develop.svn.wordpress.org/trunk@33838 git-svn-id: http://core.svn.wordpress.org/trunk@33806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1413f2edd5
commit
13540a6b30
@ -2306,8 +2306,27 @@ function feed_links( $args = array() ) {
|
||||
|
||||
$args = wp_parse_args( $args, $defaults );
|
||||
|
||||
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";
|
||||
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";
|
||||
/**
|
||||
* Filter whether to display the posts feed link.
|
||||
*
|
||||
* @since 4.3.0
|
||||
*
|
||||
* @param bool $show Whether to display the posts feed link. Default true.
|
||||
*/
|
||||
if ( apply_filters( 'feed_links_show_posts_feed', true ) ) {
|
||||
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";
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter whether to display the comments feed link.
|
||||
*
|
||||
* @since 4.3.0
|
||||
*
|
||||
* @param bool $show Whether to display the comments feed link. Default true.
|
||||
*/
|
||||
if ( apply_filters( 'feed_links_show_comments_feed', true ) ) {
|
||||
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";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-alpha-33837';
|
||||
$wp_version = '4.4-alpha-33838';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user