From c39a4a644734015f9805afb181ddbc7dc6d7ae6b Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Sun, 27 Sep 2015 02:16:23 +0000 Subject: [PATCH] Pass the post ID to the `get_the_categories` filter. Props SergeyBiryukov. See #9227. git-svn-id: https://develop.svn.wordpress.org/trunk@34624 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/category-template.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/category-template.php b/src/wp-includes/category-template.php index f57e3d291e..019854d127 100644 --- a/src/wp-includes/category-template.php +++ b/src/wp-includes/category-template.php @@ -91,10 +91,12 @@ function get_the_category( $id = false ) { * Filter the array of categories to return for a post. * * @since 3.1.0 + * @since 4.4.0 Added `$id` parameter. * * @param array $categories An array of categories to return for the post. + * @param int $id ID of the post. */ - return apply_filters( 'get_the_categories', $categories ); + return apply_filters( 'get_the_categories', $categories, $id ); } /**