feed_links
函数
feed_links ( $args = array() )
- 参数
-
-
(array)
$args
Optional arguments.- Required: 否
- Default: array()
-
(array)
- 定义位置
-
-
wp-includes/general-template.php
, line 3085
-
wp-includes/general-template.php
- 引入
- 2.8.0
- 弃用
- –
Displays the links to the general feeds.
function feed_links( $args = array() ) { if ( ! current_theme_supports( 'automatic-feed-links' ) ) { return; } $defaults = array( /* translators: Separator between blog name and feed type in feed links. */ 'separator' => _x( '»', 'feed link' ), /* translators: 1: Blog title, 2: Separator (raquo). */ 'feedtitle' => __( '%1$s %2$s Feed' ), /* translators: 1: Blog title, 2: Separator (raquo). */ 'comstitle' => __( '%1$s %2$s Comments Feed' ), ); $args = wp_parse_args( $args, $defaults ); /** * Filters whether to display the posts feed link. * * @since 4.4.0 * * @param bool $show Whether to display the posts feed link. Default true. */ if ( apply_filters( 'feed_links_show_posts_feed', true ) ) { printf( '' . "n", feed_content_type(), esc_attr( sprintf( $args['feedtitle'], get_bloginfo( 'name' ), $args['separator'] ) ), esc_url( get_feed_link() ) ); } /** * Filters whether to display the comments feed link. * * @since 4.4.0 * * @param bool $show Whether to display the comments feed link. Default true. */ if ( apply_filters( 'feed_links_show_comments_feed', true ) ) { printf( '' . "n", feed_content_type(), esc_attr( sprintf( $args['comstitle'], get_bloginfo( 'name' ), $args['separator'] ) ), esc_url( get_feed_link( 'comments_' . get_default_feed() ) ) ); } }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。