apply_filters( 'display_media_states', string[] $media_states, WP_Post $post )
- Since
- 3.2.0, 4.8.0
Filters the default media display states for items in the Media list table.
Compatibility
- WordPress
- since 4.8.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$media_statesstring[]- An array of media states. Default 'Header Image', 'Background Image', 'Site Icon', 'Logo'.
$postWP_Post- The current attachment object.
Where this hook fires · 1
wp-admin/includes/template.php:2486get_media_states()
Source code
* @since 4.8.0 Added the `$post` parameter. * * @param string[] $media_states An array of media states. Default 'Header Image', * 'Background Image', 'Site Icon', 'Logo'. * @param WP_Post $post The current attachment object. */ return apply_filters( 'display_media_states', $media_states, $post );} /** * Tests support for compressing JavaScript from PHP. * * Outputs JavaScript that tests if compression from PHP works as expectedChangelog
Introduced in 3.2.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
4.8.0
Added the
$post parameter.from the docblock3.2.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.