WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_Widget_Media::display_media_state() public WP 4.8.0

Filters the default media display states for items in the Media list table.

Это метод класса: WP_Widget_Media{}

Хуков нет.

Возвращает

Массив.

Использование

$WP_Widget_Media = new WP_Widget_Media();
$WP_Widget_Media->display_media_state( $states, $post );
$states(массив) (обязательный)
An array of media states.
$post(WP_Post)
The current attachment object.
По умолчанию: null

Список изменений

С версии 4.8.0 Введена.

Код WP Widget Media::display media state: wp-includes/widgets/class-wp-widget-media.php WP 5.5.1

<?php
public function display_media_state( $states, $post = null ) {
	if ( ! $post ) {
		$post = get_post();
	}

	// Count how many times this attachment is used in widgets.
	$use_count = 0;
	foreach ( $this->get_settings() as $instance ) {
		if ( isset( $instance['attachment_id'] ) && $instance['attachment_id'] === $post->ID ) {
			$use_count++;
		}
	}

	if ( 1 === $use_count ) {
		$states[] = $this->l10n['media_library_state_single'];
	} elseif ( $use_count > 0 ) {
		$states[] = sprintf( translate_nooped_plural( $this->l10n['media_library_state_multi'], $use_count ), number_format_i18n( $use_count ) );
	}

	return $states;
}