Title: WP_Plugins_List_Table::get_views
Published: April 25, 2014
Last modified: August 20, 2026

---

# WP_Plugins_List_Table::get_views(): array<string,

## In this article

 * [Return](https://developer.wordpress.org/reference/classes/wp_plugins_list_table/get_views/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_plugins_list_table/get_views/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/classes/wp_plugins_list_table/get_views/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/classes/wp_plugins_list_table/get_views/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_plugins_list_table/get_views/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_plugins_list_table/get_views/?output_format=md#wp--skip-link--target)

Gets an associative array of status filter links for the views area.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_plugins_list_table/get_views/?output_format=md#return)󠁿

 array<string, string> An associative array of views.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_plugins_list_table/get_views/?output_format=md#source)󠁿

    ```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: Number of plugins. */
    				$text = _nx(
    					'All <span class="count">(%s)</span>',
    					'All <span class="count">(%s)</span>',
    					$count,
    					'plugins'
    				);
    				break;
    			case 'active':
    				/* translators: %s: Number of plugins. */
    				$text = _n(
    					'Active <span class="count">(%s)</span>',
    					'Active <span class="count">(%s)</span>',
    					$count
    				);
    				break;
    			case 'recently_activated':
    				/* translators: %s: Number of plugins. */
    				$text = _n(
    					'Recently Active <span class="count">(%s)</span>',
    					'Recently Active <span class="count">(%s)</span>',
    					$count
    				);
    				break;
    			case 'inactive':
    				/* translators: %s: Number of plugins. */
    				$text = _n(
    					'Inactive <span class="count">(%s)</span>',
    					'Inactive <span class="count">(%s)</span>',
    					$count
    				);
    				break;
    			case 'mustuse':
    				/* translators: %s: Number of plugins. */
    				$text = _n(
    					'Must-Use <span class="count">(%s)</span>',
    					'Must-Use <span class="count">(%s)</span>',
    					$count
    				);
    				break;
    			case 'dropins':
    				/* translators: %s: Number of plugins. */
    				$text = _n(
    					'Drop-in <span class="count">(%s)</span>',
    					'Drop-ins <span class="count">(%s)</span>',
    					$count
    				);
    				break;
    			case 'paused':
    				/* translators: %s: Number of plugins. */
    				$text = _n(
    					'Paused <span class="count">(%s)</span>',
    					'Paused <span class="count">(%s)</span>',
    					$count
    				);
    				break;
    			case 'upgrade':
    				/* translators: %s: Number of plugins. */
    				$text = _n(
    					'Update Available <span class="count">(%s)</span>',
    					'Update Available <span class="count">(%s)</span>',
    					$count
    				);
    				break;
    			case 'auto-update-enabled':
    				/* translators: %s: Number of plugins. */
    				$text = _n(
    					'Auto-updates Enabled <span class="count">(%s)</span>',
    					'Auto-updates Enabled <span class="count">(%s)</span>',
    					$count
    				);
    				break;
    			case 'auto-update-disabled':
    				/* translators: %s: Number of plugins. */
    				$text = _n(
    					'Auto-updates Disabled <span class="count">(%s)</span>',
    					'Auto-updates Disabled <span class="count">(%s)</span>',
    					$count
    				);
    				break;
    			default:
    				/**
    				 * Filters the status text of default switch case in the plugins list table.
    				 *
    				 * @since 7.0.0
    				 *
    				 * @param string $text  Plugins list status text. Default empty string.
    				 * @param int    $count Count of the number of plugins.
    				 * @param string $type  The status slug being filtered.
    				 */
    				$text = apply_filters( 'plugins_list_status_text', '', $count, $type );
    				if ( empty( $text ) || ! is_string( $text ) ) {
    					$text = $type;
    				}
    				$text = esc_html( $text ) . ' ' . sprintf(
    					'<span class="count">(%s)</span>',
    					number_format_i18n( $count )
    				);
    				break;
    		}

    		if ( 'search' !== $type ) {
    			$status_links[ $type ] = array(
    				'url'     => add_query_arg( 'plugin_status', $type, 'plugins.php' ),
    				'label'   => sprintf( $text, number_format_i18n( $count ) ),
    				'current' => $type === $status,
    			);
    		}
    	}

    	return $this->get_views_links( $status_links );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-plugins-list-table.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-admin/includes/class-wp-plugins-list-table.php#L532)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-plugins-list-table.php#L532-L654)

## 󠀁[Hooks](https://developer.wordpress.org/reference/classes/wp_plugins_list_table/get_views/?output_format=md#hooks)󠁿

 [apply_filters( ‘plugins_list_status_text’, string $text, int $count, string $type )](https://developer.wordpress.org/reference/hooks/plugins_list_status_text/)

Filters the status text of default switch case in the plugins list table.

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_plugins_list_table/get_views/?output_format=md#related)󠁿

| Uses | Description | 
| [_nx()](https://developer.wordpress.org/reference/functions/_nx/)`wp-includes/l10n.php` |

Translates and retrieves the singular or plural form based on the supplied number, with gettext context.

  | 
| [_n()](https://developer.wordpress.org/reference/functions/_n/)`wp-includes/l10n.php` |

Translates and retrieves the singular or plural form based on the supplied number.

  | 
| [esc_html()](https://developer.wordpress.org/reference/functions/esc_html/)`wp-includes/formatting.php` |

Escaping for HTML blocks.

  | 
| [add_query_arg()](https://developer.wordpress.org/reference/functions/add_query_arg/)`wp-includes/functions.php` |

Retrieves a modified URL query string.

  | 
| [number_format_i18n()](https://developer.wordpress.org/reference/functions/number_format_i18n/)`wp-includes/functions.php` |

Converts float number to format based on the locale.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

[Show 4 more](https://developer.wordpress.org/reference/classes/wp_plugins_list_table/get_views/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_plugins_list_table/get_views/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_plugins_list_table/get_views/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_plugins_list_table%2Fget_views%2F)
before being able to contribute a note or feedback.