WordPress at Your Fingertips
function is not described

_media_states() WP 3.2.0

Outputs the attachment media states as HTML.

This is an internal function for using it by WP core itself. It's not recommended to use this function in your code.

No Hooks.

Return

String. Media states string.

Usage

_media_states( $post, $echo );
$post(WP_Post) (required)
The attachment post to retrieve states for.
$echo(true|false)
Whether to echo the post states as an HTML string.
Default: true

Changelog

Since 3.2.0 Introduced.
Since 5.6.0 Added the $echo parameter and a return value.

Code of _media_states() WP 5.8.2

function _media_states( $post, $echo = true ) {
	$media_states        = get_media_states( $post );
	$media_states_string = '';

	if ( ! empty( $media_states ) ) {
		$state_count = count( $media_states );
		$i           = 0;

		$media_states_string .= ' — ';

		foreach ( $media_states as $state ) {
			$sep = ( ++$i === $state_count ) ? '' : ', ';

			$media_states_string .= "<span class='post-state'>$state$sep</span>";
		}
	}

	if ( $echo ) {
		echo $media_states_string;
	}

	return $media_states_string;
}