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.

Built from https://develop.svn.wordpress.org/trunk@56623


git-svn-id: http://core.svn.wordpress.org/trunk@56135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Joe McGill 2023-09-19 17:05:21 +00:00
parent e1e541a1b3
commit 0475a61f8a
2 changed files with 2 additions and 2 deletions

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

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.4-alpha-56622';
$wp_version = '6.4-alpha-56623';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.