Feeds: Introduce `feed_links_args` and `feed_links_extra_args` filters.

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.
Built from https://develop.svn.wordpress.org/trunk@58821


git-svn-id: http://core.svn.wordpress.org/trunk@58217 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2024-07-28 18:27:17 +00:00
parent 8e77c7711e
commit 05e35e900e
2 changed files with 19 additions and 1 deletions

View File

@ -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.
*
@ -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 );

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.7-alpha-58820';
$wp_version = '6.7-alpha-58821';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.