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
This commit is contained in:
Joe McGill 2023-09-19 17:03:23 +00:00
parent 7d96189ba1
commit 3bacfc9f97

View File

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