feed_links_extra( array $args = array() )
- Since
- 2.8.0
- Source
wp-includes/general-template.php:3304
Compatibility
- WordPress
- since 2.8.0
- PHP
- 7.4–8.6-dev
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.
Parameters
$argsarrayoptional- Optional arguments.Default:
array()
Performance profile
How much work a call to feed_links_extra() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.
- Cost class
- Heavy
- Scaling
- Constant
- Instructions
- 63–126
- Plugin surface
- 9 hooks
- Called by
- 0
Reaches the database via get_post().
No loop in the body: the same number of instructions runs whatever you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 338.
Third-party callbacks on 'feed_links_extra_args', 'feed_links_show_comments_feed', 'feed_links_extra_show_post_comments_feed' run inside this call, and their cost is not bounded by anything here.
Nothing in core calls this; the cost is only what you spend yourself.
What it touches
- hookthird-party callbacks
apply_filters()called directly - querycontent query
get_post()one call below feed_links_extra() - optionoption read or write
get_option()one call below feed_links_extra()
Further down the call graph this can also reach cache, serialize and transient. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 42 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost feed_links_extra() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
is_post_type_archive() | 63–67 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), apply_filters() |
!is_post_type_archive() && is_category() | 66–70 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), apply_filters() |
is_singular() && $queried_object instanceof | 68–70 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), apply_filters(), apply_filters() |
!is_post_type_archive() && !is_category() && is_tag() | 69–73 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), apply_filters() |
!is_post_type_archive() && is_category() | 70–74 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), apply_filters(), get_queried_object() |
!is_post_type_archive() && !is_category() && !is_tag() && is_tax() | 72–76 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), is_tax(), apply_filters() |
!is_post_type_archive() && !is_category() && !is_tag() && !is_tax() && !is_author() && !is_search() | 72–76 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), is_tax(), is_author(), is_search() |
!is_post_type_archive() && !is_category() && is_tag() | 73–77 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), apply_filters(), get_queried_object() |
!is_post_type_archive() && !is_category() && !is_tag() && !is_tax() && is_author() | 75–79 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), is_tax(), is_author(), apply_filters() |
!is_post_type_archive() && !is_category() && !is_tag() && is_tax() | 76–80 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), is_tax(), apply_filters(), get_queried_object() |
!is_post_type_archive() && !is_category() && !is_tag() && !is_tax() && !is_author() && is_search() | 78–82 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), is_tax(), is_author(), is_search(), apply_filters() |
is_post_type_archive() && isset($title) && isset($href) | 79–81 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), apply_filters(), feed_content_type(), esc_attr(), esc_url(), printf() |
30 further outcomes, up to 126 instructions
is_singular() && $queried_object instanceof && !comments_open() && !pings_open() | 80–82 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), apply_filters(), apply_filters(), comments_open(), pings_open() |
!is_post_type_archive() && is_category() && isset($title) && isset($href) | 82–84 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), apply_filters(), feed_content_type(), esc_attr(), esc_url(), printf() |
is_singular() && $queried_object instanceof && isset($title) && isset($href) | 84 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), apply_filters(), apply_filters(), feed_content_type(), esc_attr(), esc_url(), printf() |
!is_post_type_archive() && !is_category() && is_tag() && isset($title) && isset($href) | 85–87 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), apply_filters(), feed_content_type(), esc_attr(), esc_url(), printf() |
!is_post_type_archive() && is_category() && isset($title) && isset($href) | 86–88 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), apply_filters(), get_queried_object(), feed_content_type(), esc_attr(), esc_url(), printf() |
!is_post_type_archive() && !is_category() && !is_tag() && is_tax() && isset($title) && isset($href) | 88–90 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), is_tax(), apply_filters(), feed_content_type(), esc_attr(), esc_url(), printf() |
!is_post_type_archive() && !is_category() && !is_tag() && !is_tax() && !is_author() && !is_search() && isset($title) && isset($href) | 88–90 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), is_tax(), is_author(), is_search(), feed_content_type(), esc_attr(), esc_url(), printf() |
!is_post_type_archive() && !is_category() && is_tag() && isset($title) && isset($href) | 89–91 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), apply_filters(), get_queried_object(), feed_content_type(), esc_attr(), esc_url(), printf() |
!is_post_type_archive() && is_category() | 90–94 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), apply_filters(), get_queried_object(), get_bloginfo(), sprintf(), get_category_feed_link() |
!is_post_type_archive() && !is_category() && !is_tag() && !is_tax() && is_author() && isset($title) && isset($href) | 91–93 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), is_tax(), is_author(), apply_filters(), feed_content_type(), esc_attr(), esc_url(), printf() |
!is_post_type_archive() && !is_category() && !is_tag() && is_tax() && isset($title) && isset($href) | 92–94 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), is_tax(), apply_filters(), get_queried_object(), feed_content_type(), esc_attr(), esc_url(), printf() |
!is_post_type_archive() && !is_category() && is_tag() | 93–97 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), apply_filters(), get_queried_object(), get_bloginfo(), sprintf(), get_tag_feed_link() |
is_post_type_archive() && !is_array($post_type) | 94–98 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), apply_filters(), get_query_var(), get_post_type_object(), get_bloginfo(), sprintf(), get_post_type_archive_feed_link() |
!is_post_type_archive() && !is_category() && !is_tag() && !is_tax() && !is_author() && is_search() && isset($title) && isset($href) | 94–96 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), is_tax(), is_author(), is_search(), apply_filters(), feed_content_type(), esc_attr(), esc_url(), printf() |
is_singular() && $queried_object instanceof && comments_open() | 96–100 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), apply_filters(), apply_filters(), comments_open(), get_bloginfo(), echo(), the_title_attribute(), get_post_comments_feed_link() |
is_singular() && $queried_object instanceof && !comments_open() && !pings_open() && isset($title) && isset($href) | 96 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), apply_filters(), apply_filters(), comments_open(), pings_open(), feed_content_type(), esc_attr(), esc_url(), printf() |
!is_post_type_archive() && !is_category() && !is_tag() && !is_tax() && !is_author() && is_search() | 96–100 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), is_tax(), is_author(), is_search(), apply_filters(), get_bloginfo(), get_search_query(), sprintf(), get_search_feed_link() |
is_post_type_archive() && is_array($post_type) | 98–102 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), apply_filters(), get_query_var(), reset(), get_post_type_object(), get_bloginfo(), sprintf(), get_post_type_archive_feed_link() |
is_singular() && $queried_object instanceof && !comments_open() | 100–108 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), apply_filters(), apply_filters(), comments_open(), pings_open(), get_bloginfo(), echo(), the_title_attribute(), get_post_comments_feed_link() |
!is_post_type_archive() && !is_category() && !is_tag() && !is_tax() && is_author() | 100–104 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), is_tax(), is_author(), apply_filters(), get_query_var(), get_bloginfo(), get_the_author_meta(), sprintf(), get_author_feed_link() |
!is_post_type_archive() && is_category() && isset($title) && isset($href) | 106–108 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), apply_filters(), get_queried_object(), get_bloginfo(), sprintf(), get_category_feed_link(), feed_content_type(), esc_attr(), esc_url(), printf() |
!is_post_type_archive() && !is_category() && !is_tag() && is_tax() | 108–112 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), is_tax(), apply_filters(), get_queried_object(), get_taxonomy(), get_bloginfo(), sprintf(), get_term_feed_link() |
!is_post_type_archive() && !is_category() && is_tag() && isset($title) && isset($href) | 109–111 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), apply_filters(), get_queried_object(), get_bloginfo(), sprintf(), get_tag_feed_link(), feed_content_type(), esc_attr(), esc_url(), printf() |
is_post_type_archive() && !is_array($post_type) && isset($title) && isset($href) | 110–112 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), apply_filters(), get_query_var(), get_post_type_object(), get_bloginfo(), sprintf(), get_post_type_archive_feed_link(), feed_content_type(), esc_attr(), esc_url(), printf() |
is_singular() && $queried_object instanceof && comments_open() && isset($title) && isset($href) | 112–114 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), apply_filters(), apply_filters(), comments_open(), get_bloginfo(), echo(), the_title_attribute(), get_post_comments_feed_link(), feed_content_type(), esc_attr(), esc_url(), printf() |
!is_post_type_archive() && !is_category() && !is_tag() && !is_tax() && !is_author() && is_search() && isset($title) && isset($href) | 112–114 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), is_tax(), is_author(), is_search(), apply_filters(), get_bloginfo(), get_search_query(), sprintf(), get_search_feed_link(), feed_content_type(), esc_attr(), esc_url(), printf() |
is_post_type_archive() && is_array($post_type) && isset($title) && isset($href) | 114–116 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), apply_filters(), get_query_var(), reset(), get_post_type_object(), get_bloginfo(), sprintf(), get_post_type_archive_feed_link(), feed_content_type(), esc_attr(), esc_url(), printf() |
is_singular() && $queried_object instanceof && !comments_open() && isset($title) && isset($href) | 116–122 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), apply_filters(), apply_filters(), comments_open(), pings_open(), get_bloginfo(), echo(), the_title_attribute(), get_post_comments_feed_link(), feed_content_type(), esc_attr(), esc_url(), printf() |
!is_post_type_archive() && !is_category() && !is_tag() && !is_tax() && is_author() && isset($title) && isset($href) | 116–118 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), is_tax(), is_author(), apply_filters(), get_query_var(), get_bloginfo(), get_the_author_meta(), sprintf(), get_author_feed_link(), feed_content_type(), esc_attr(), esc_url(), printf() |
!is_post_type_archive() && !is_category() && !is_tag() && is_tax() && isset($title) && isset($href) | 124–126 | _x(), __(), __(), __(), __(), __(), __(), __(), wp_parse_args(), apply_filters(), get_queried_object(), is_singular(), is_post_type_archive(), is_category(), is_tag(), is_tax(), apply_filters(), get_queried_object(), get_taxonomy(), get_bloginfo(), sprintf(), get_term_feed_link(), feed_content_type(), esc_attr(), esc_url(), printf() |
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 340 | 63–128 | 25 | 2 more instructions than PHP 8.5 |
| 8.5 | 338 | 63–126 | 25 | |
| 8.4 | 338 | 63–126 | 25 | |
| 8.3 | 338 | 63–126 | 25 | |
| 8.2 | 338 | 63–126 | 25 | |
| 8.1 | 338 | 63–126 | 25 | |
| 7.4 | 338 | 63–126 | 25 |
An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.
Hooks and filters fired · 9
9 hooks fire while feed_links_extra() runs, in this order:
- apply_filters( feed_links_extra_args )filterline 3333 (+29 into the body)
Filters the extra feed links arguments.
- apply_filters( feed_links_show_comments_feed )filterline 3344 (+40 into the body)
Filters whether to display the comments feed link.
- apply_filters( feed_links_extra_show_post_comments_feed )filterline 3359 (+55 into the body)
Filters whether to display the post comments feed link.
- apply_filters( feed_links_extra_show_post_type_archive_feed )filterline 3388 (+84 into the body)
Filters whether to display the post type archive feed link.
- apply_filters( feed_links_extra_show_category_feed )filterline 3416 (+112 into the body)
Filters whether to display the category feed link.
- apply_filters( feed_links_extra_show_tag_feed )filterline 3440 (+136 into the body)
Filters whether to display the tag feed link.
- apply_filters( feed_links_extra_show_tax_feed )filterline 3464 (+160 into the body)
Filters whether to display the custom taxonomy feed link.
- apply_filters( feed_links_extra_show_author_feed )filterline 3491 (+187 into the body)
Filters whether to display the author feed link.
- apply_filters( feed_links_extra_show_search_feed )filterline 3513 (+209 into the body)
Filters whether to display the search results feed link.
Uses · 31
- _x()Retrieves translated string with gettext context.
- __()Retrieves the translation of $text.
- wp_parse_args()Merges user defined arguments into defaults array.
- apply_filters()Calls the callback functions that have been added to a filter hook.
- get_queried_object()Retrieves the currently queried object.
- is_singular()Determines whether the query is for an existing single post of any post type (post, attachment, page, custom post types).
- comments_open()Determines whether the current post is open for comments.
- pings_open()Determines whether the current post is open for pings.
- get_bloginfo()Retrieves information about the current site.
- the_title_attribute()Sanitizes the current title when retrieving or displaying.
- get_post_comments_feed_link()Retrieves the permalink for the post comments feed.
- is_post_type_archive()Determines whether the query is for an existing post type archive page.
Show all 31
- get_query_var()Retrieves the value of a query variable in the WP_Query class.
- get_post_type_object()Retrieves a post type object by name.
- get_post_type_archive_feed_link()Retrieves the permalink for a post type archive feed.
- is_category()Determines whether the query is for an existing category archive page.
- get_category_feed_link()Retrieves the feed link for a category.
- is_tag()Determines whether the query is for an existing tag archive page.
- get_tag_feed_link()Retrieves the permalink for a tag feed.
- is_tax()Determines whether the query is for an existing custom taxonomy archive page.
- get_taxonomy()Retrieves the taxonomy object of $taxonomy.
- get_term_feed_link()Retrieves the feed link for a term.
- is_author()Determines whether the query is for an existing author archive page.
- get_the_author_meta()Retrieves the requested data of the author of the current post.
- get_author_feed_link()Retrieves the feed link for a given author.
- is_search()Determines whether the query is for a search.
- get_search_query()Retrieves the contents of the search WordPress query variable.
- get_search_feed_link()Retrieves the permalink for the search results feed.
- feed_content_type()Returns the content type for specified feed type.
- esc_attr()Escaping for HTML attributes.
- esc_url()Checks and cleans a URL.
Source code
function feed_links_extra( $args = array() ) { $defaults = array( /* translators: Separator between site name and feed type in feed links. */ 'separator' => _x( '»', 'feed link' ), /* translators: 1: Site name, 2: Separator (raquo), 3: Post title. */ 'singletitle' => __( '%1$s %2$s %3$s Comments Feed' ), /* translators: 1: Site name, 2: Separator (raquo), 3: Category name. */ 'cattitle' => __( '%1$s %2$s %3$s Category Feed' ), /* translators: 1: Site name, 2: Separator (raquo), 3: Tag name. */ 'tagtitle' => __( '%1$s %2$s %3$s Tag Feed' ), /* translators: 1: Site name, 2: Separator (raquo), 3: Term name, 4: Taxonomy singular name. */ 'taxtitle' => __( '%1$s %2$s %3$s %4$s Feed' ), /* translators: 1: Site name, 2: Separator (raquo), 3: Author name. */ 'authortitle' => __( '%1$s %2$s Posts by %3$s Feed' ), /* translators: 1: Site name, 2: Separator (raquo), 3: Search query. */ 'searchtitle' => __( '%1$s %2$s Search Results for “%3$s” Feed' ), /* translators: 1: Site name, 2: Separator (raquo), 3: Post type name. */ 'posttypetitle' => __( '%1$s %2$s %3$s Feed' ), ); $args = wp_parse_args( $args, $defaults ); /** * Filters the extra feed links arguments. * * @since 6.7.0 * * @param array $args An array of extra feed links arguments. */ $args = apply_filters( 'feed_links_extra_args', $args ); /* * The template conditionals are referring to the global query, so the queried object is used rather than * depending on a global $post being set. */ $queried_object = get_queried_object(); if ( is_singular() && $queried_object instanceof WP_Post ) { $post = $queried_object; /** This filter is documented in wp-includes/general-template.php */ $show_comments_feed = apply_filters( 'feed_links_show_comments_feed', true ); /** * Filters whether to display the post comments feed link. * * This filter allows to enable or disable the feed link for a singular post * in a way that is independent of {@see 'feed_links_show_comments_feed'} * (which controls the global comments feed). The result of that filter * is accepted as a parameter. * * @since 6.1.0 * * @param bool $show_comments_feed Whether to display the post comments feed link. Defaults to * the {@see 'feed_links_show_comments_feed'} filter result. */ $show_post_comments_feed = apply_filters( 'feed_links_extra_show_post_comments_feed', $show_comments_feed ); if ( $show_post_comments_feed && ( comments_open( $post ) || pings_open( $post ) || (int) $post->comment_count > 0 ) ) { $title = sprintf( $args['singletitle'], get_bloginfo( 'name' ), $args['separator'], the_title_attribute( array( 'echo' => false, 'post' => $post, ) ) ); $feed_link = get_post_comments_feed_link( $post->ID ); if ( $feed_link ) { $href = $feed_link; } } } elseif ( is_post_type_archive() ) { /** * Filters whether to display the post type archive feed link. *Changelog
Introduced in 2.8.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.9.7 tag, from
src/wp-includes/general-template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.