Media: Pass the current attachment object to `display_media_states` filter, for consistency with `display_post_states`.

Props pbiron, chriseverson.
Fixes #39628.

git-svn-id: https://develop.svn.wordpress.org/trunk@39926 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2017-01-20 05:19:26 +00:00
parent 7a9d5c9ab9
commit 1925fd16e4
1 changed files with 6 additions and 3 deletions

View File

@ -1726,6 +1726,7 @@ function _post_states($post) {
* Filters the default post display states used in the posts list table.
*
* @since 2.8.0
* @since 3.6.0 Added the `$post` parameter.
*
* @param array $post_states An array of post display states.
* @param WP_Post $post The current post object.
@ -1802,11 +1803,13 @@ function _media_states( $post ) {
* Filters the default media display states for items in the Media list table.
*
* @since 3.2.0
* @since 4.8.0 Added the `$post` parameter.
*
* @param array $media_states An array of media states. Default 'Header Image',
* 'Background Image', 'Site Icon', 'Logo'.
* @param WP_Post $post The current attachment object.
*/
$media_states = apply_filters( 'display_media_states', $media_states );
$media_states = apply_filters( 'display_media_states', $media_states, $post );
if ( ! empty( $media_states ) ) {
$state_count = count( $media_states );