display_site_states
Filters the default site display states for items in the Sites list table.
Usage
add_filter( 'display_site_states', 'wp_kama_display_site_states_filter', 10, 2 ); /** * Function for `display_site_states` filter-hook. * * @param string[] $site_states An array of site states. * @param WP_Site $site The current site object. * * @return string[] */ function wp_kama_display_site_states_filter( $site_states, $site ){ // filter... return $site_states; }
- $site_states(string[])
- An array of site states.
Default: 'Main', 'Archived', 'Mature', 'Spam', 'Deleted' - $site(WP_Site)
- The current site object.
Changelog
Since 5.3.0 | Introduced. |
Where the hook is called
display_site_states
wp-admin/includes/class-wp-ms-sites-list-table.php 671
$site_states = apply_filters( 'display_site_states', $site_states, $_site );