From 3bacfc9f978876549ee0e2b5068be02e006d956c Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Tue, 19 Sep 2023 17:03:23 +0000 Subject: [PATCH] Media: Edit new hook name in `get_available_post_mime_types()`. This is a follow-up to [56452] in which a new filter hook was added to `get_available_post_mime_types()` to override a potentially slow query. This renames the previous hook from `get_available_post_mime_types` to `pre_get_available_post_mime_types` for clarity. Props rcorrales, emrikol, johnbillion, joemcgill, mukesh27. Fixes #52759. git-svn-id: https://develop.svn.wordpress.org/trunk@56623 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 7100e7c3ac..696e74ed2c 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -7888,7 +7888,7 @@ function get_available_post_mime_types( $type = 'attachment' ) { * @param string[]|null $mime_types An array of MIME types. Default null. * @param string $type The post type name. Usually 'attachment' but can be any post type. */ - $mime_types = apply_filters( 'get_available_post_mime_types', null, $type ); + $mime_types = apply_filters( 'pre_get_available_post_mime_types', null, $type ); if ( ! is_array( $mime_types ) ) { $mime_types = $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT post_mime_type FROM $wpdb->posts WHERE post_type = %s", $type ) );