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

WP_Plugins_List_Table::get_views() WP 1.0

Это метод класса: WP_Plugins_List_Table

Хуков нет.

Возвращает

Массив.

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

$WP_Plugins_List_Table = new WP_Plugins_List_Table();
$var = $WP_Plugins_List_Table->get_views();

Заметки

  • Global. Массив. $totals
  • Global. Строка. $status

Код WP Plugins List Table::get views: wp-admin/includes/class-wp-plugins-list-table.php WP 5.2.2

<?php
protected function get_views() {
	global $totals, $status;

	$status_links = array();
	foreach ( $totals as $type => $count ) {
		if ( ! $count ) {
			continue;
		}

		switch ( $type ) {
			case 'all':
				/* translators: %s: plugin count */
				$text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'plugins' );
				break;
			case 'active':
				/* translators: %s: plugin count */
				$text = _n( 'Active <span class="count">(%s)</span>', 'Active <span class="count">(%s)</span>', $count );
				break;
			case 'recently_activated':
				/* translators: %s: plugin count */
				$text = _n( 'Recently Active <span class="count">(%s)</span>', 'Recently Active <span class="count">(%s)</span>', $count );
				break;
			case 'inactive':
				/* translators: %s: plugin count */
				$text = _n( 'Inactive <span class="count">(%s)</span>', 'Inactive <span class="count">(%s)</span>', $count );
				break;
			case 'mustuse':
				/* translators: %s: plugin count */
				$text = _n( 'Must-Use <span class="count">(%s)</span>', 'Must-Use <span class="count">(%s)</span>', $count );
				break;
			case 'dropins':
				/* translators: %s: plugin count */
				$text = _n( 'Drop-in <span class="count">(%s)</span>', 'Drop-ins <span class="count">(%s)</span>', $count );
				break;
			case 'paused':
				/* translators: %s: plugin count */
				$text = _n( 'Paused <span class="count">(%s)</span>', 'Paused <span class="count">(%s)</span>', $count );
				break;
			case 'upgrade':
				/* translators: %s: plugin count */
				$text = _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count );
				break;
		}

		if ( 'search' !== $type ) {
			$status_links[ $type ] = sprintf(
				"<a href='%s'%s>%s</a>",
				add_query_arg( 'plugin_status', $type, 'plugins.php' ),
				( $type === $status ) ? ' class="current" aria-current="page"' : '',
				sprintf( $text, number_format_i18n( $count ) )
			);
		}
	}

	return $status_links;
}