wphooks.info - display_media_states

display_media_states

(trunk - 5.0-alpha-42177)

The hook occurs in the following file:

wp-admin/includes/template.php:
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
	/**
	 * 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, $post );

	if ( ! empty( $media_states ) ) {
		$state_count = count( $media_states );
		$i = 0;
		echo ' — ';
		foreach ( $media_states as $state ) {
			++$i;
			( $i == $state_count ) ? $sep = '' : $sep = ', ';
			echo "<span class='post-state'>$state$sep</span>";