Make WordPress Core

Changeset 39926


Ignore:
Timestamp:
01/20/2017 05:19:26 AM (7 years ago)
Author:
SergeyBiryukov
Message:

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

Props pbiron, chriseverson.
Fixes #39628.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/template.php

    r39925 r39926  
    17271727     *
    17281728     * @since 2.8.0
     1729     * @since 3.6.0 Added the `$post` parameter.
    17291730     *
    17301731     * @param array   $post_states An array of post display states.
     
    18031804     *
    18041805     * @since 3.2.0
     1806     * @since 4.8.0 Added the `$post` parameter.
    18051807     *
    1806      * @param array $media_states An array of media states. Default 'Header Image',
    1807      *                            'Background Image', 'Site Icon', 'Logo'.
     1808     * @param array   $media_states An array of media states. Default 'Header Image',
     1809     *                              'Background Image', 'Site Icon', 'Logo'.
     1810     * @param WP_Post $post         The current attachment object.
    18081811     */
    1809     $media_states = apply_filters( 'display_media_states', $media_states );
     1812    $media_states = apply_filters( 'display_media_states', $media_states, $post );
    18101813
    18111814    if ( ! empty( $media_states ) ) {
Note: See TracChangeset for help on using the changeset viewer.