feed_links

Display the links to the general feeds.

Description

feed_links( (array) $args = array() ); 

Parameters (1)

0. $args — Optional. (array) => array()
Arguments.

Usage

  1. if ( !function_exists( 'feed_links' ) ) { 
  2. require_once ABSPATH . WPINC . '/general-template.php'; 
  3.  
  4. // Optional arguments. 
  5. $args = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = feed_links($args); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/general-template.php  
  1. function feed_links( $args = array() ) { 
  2. if ( !current_theme_supports('automatic-feed-links') ) 
  3. return; 
  4.  
  5. $defaults = array( 
  6. /** translators: Separator between blog name and feed type in feed links */ 
  7. 'separator' => _x('»', 'feed link'),  
  8. /** translators: 1: blog title, 2: separator (raquo) */ 
  9. 'feedtitle' => __('%1$s %2$s Feed'),  
  10. /** translators: 1: blog title, 2: separator (raquo) */ 
  11. 'comstitle' => __('%1$s %2$s Comments Feed'),  
  12. ); 
  13.  
  14. $args = wp_parse_args( $args, $defaults ); 
  15.  
  16. /** 
  17. * Filters whether to display the posts feed link. 
  18. * @since 4.4.0 
  19. * @param bool $show Whether to display the posts feed link. Default true. 
  20. */ 
  21. 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"; 
  22.  
  23. /** 
  24. * Filters whether to display the comments feed link. 
  25. * @since 4.4.0 
  26. * @param bool $show Whether to display the comments feed link. Default true. 
  27. */ 
  28. 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";