From 6f8644aeb21e40e901a4d6569de54793ceb2e736 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 20 Jan 2017 05:20:41 +0000 Subject: [PATCH] Media: Pass the current attachment object to `display_media_states` filter, for consistency with `display_post_states`. Props pbiron, chriseverson. Fixes #39628. Built from https://develop.svn.wordpress.org/trunk@39926 git-svn-id: http://core.svn.wordpress.org/trunk@39863 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template.php | 9 ++++++--- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index e655f97911..83b16bb12c 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -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 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 ); diff --git a/wp-includes/version.php b/wp-includes/version.php index e0336dd05f..b9f20a08e3 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-39925'; +$wp_version = '4.8-alpha-39926'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.