Skip to content

Commit

Permalink
Feeds: Introduce feed_links_args and feed_links_extra_args filters.
Browse files Browse the repository at this point in the history
This allows for more flexibility in modifying how feed links are displayed by the `feed_links()` and `feed_links_extra()` functions, including, for example, a way to change the `»` separator to something else.

Follow-up to [10377], [33838], [33839], [53125], [54161].

Props topdownjimmy, tw2113, williampatton.
Fixes #43225.

git-svn-id: https://develop.svn.wordpress.org/trunk@58821 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Jul 28, 2024
1 parent b59bc83 commit a3173b6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/wp-includes/general-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -3120,6 +3120,15 @@ function feed_links( $args = array() ) {

$args = wp_parse_args( $args, $defaults );

/**
* Filters the feed links arguments.
*
* @since 6.7.0
*
* @param array $args An array of feed links arguments.
*/
$args = apply_filters( 'feed_links_args', $args );

/**
* Filters whether to display the posts feed link.
*
Expand Down Expand Up @@ -3182,6 +3191,15 @@ function feed_links_extra( $args = array() ) {

$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 );

if ( is_singular() ) {
$id = 0;
$post = get_post( $id );
Expand Down

0 comments on commit a3173b6

Please sign in to comment.