From 58d649aa51b64130238d23005076a1d9243f9663 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Mon, 31 Aug 2020 17:55:24 +0000 Subject: [PATCH] Docs: Add a `@since` note to the `display_post_states` filter to clarify that it is now also applied in the Customizer context. If any admin functions are used within the filter, their existence should be checked with `function_exists()` before being used. Follow-up to [47763], [48620]. Props audrasjb, garrett-eclipse, Howdy_McGee, dlh, khag7, SergeyBiryukov. Merges [48910] to the 5.5 branch. Fixes #51081. git-svn-id: https://develop.svn.wordpress.org/branches/5.5@48915 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/template.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php index d53267c1b0..9b21045de7 100644 --- a/src/wp-admin/includes/template.php +++ b/src/wp-admin/includes/template.php @@ -2214,6 +2214,9 @@ function get_post_states( $post ) { * * @since 2.8.0 * @since 3.6.0 Added the `$post` parameter. + * @since 5.5.0 Also applied in the Customizer context. If any admin functions + * are used within the filter, their existence should be checked + * with `function_exists()` before being used. * * @param string[] $post_states An array of post display states. * @param WP_Post $post The current post object.