From 5d0e0d5da4df96a0160d2656589958300b035e04 Mon Sep 17 00:00:00 2001 From: Christoph Daum Date: Tue, 14 Jan 2025 16:44:21 +0100 Subject: [PATCH] Added: Filter to acf_get_grouped_posts() --- includes/api/api-helpers.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/includes/api/api-helpers.php b/includes/api/api-helpers.php index 09a6b481..12cf4345 100644 --- a/includes/api/api-helpers.php +++ b/includes/api/api-helpers.php @@ -1378,8 +1378,16 @@ function acf_get_grouped_posts( $args ) { $data[ $label ] = $this_group; } - // return - return $data; + /** + * Filters the results found in the `acf_get_grouped_posts()` function. + * This allows for 3rd party customization. + * + * @since tbd + * + * @param array $data The results from the `get_posts()` call. + * @param array $args The arguments passed to `acf_get_grouped_posts()`. + */ + return apply_filter( 'acf/get_grouped_posts', $data, $args ); } /**