[wp-trac] [WordPress Trac] #61026: There is no easy way to add custom states to site-info.php

WordPress Trac noreply at wordpress.org
Wed Apr 17 20:46:45 UTC 2024


#61026: There is no easy way to add custom states to site-info.php
--------------------------------+------------------------------------------
 Reporter:  ignatiusjeroe       |       Owner:  (none)
     Type:  enhancement         |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Networks and Sites  |     Version:  6.5
 Severity:  minor               |  Resolution:
 Keywords:                      |     Focuses:  multisite, coding-standards
--------------------------------+------------------------------------------

Old description:

> On /wp-admin/network/sites.php with the usage of hook listed below we can
> add new states to the page (see attachment).
>
> 1. '' $views = apply_filters( "views_{$this->screen->id}", $views );
> '' @ wp-admin/includes/class-wp-list-table.php line 515
> 2. and ''$site_states = apply_filters( 'display_site_states',
> $site_states, $_site );'' @ wp-admin/includes/class-wp-ms-sites-list-
> table.php line 671
>
> The issue is that on ''wp-admin/network/site-info.php'' there is no way
> to add our own states to the core states. There is no filter that grands
> access to the variable that contains the data which WP uses to render the
> state fields with. This should be looked at. For it makes zero sense to
> be able to add new states elsewhere but not on page ''wp-admin/network
> /site-info.php''.
>

>
> WP_Site->deleted never gets value of 2
>
> Request... add action hook to add new page/tab to sites.php

New description:

 On `/wp-admin/network/sites.php` with the usage of hook listed below we
 can add new states to the page (see attachment).

 1. `$views = apply_filters( "views_{$this->screen->id}", $views );` \\ @
 `wp-admin/includes/class-wp-list-table.php` line 515 and
 2. `$site_states = apply_filters( 'display_site_states', $site_states,
 $_site );` \\ @ `wp-admin/includes/class-wp-ms-sites-list-table.php` line
 671

 The issue is that on `wp-admin/network/site-info.php` there is no way to
 add our own states to the core states. There is no filter that grants
 access to the variable that contains the data which WP uses to render the
 state fields with. This should be looked at. For it makes zero sense to be
 able to add new states elsewhere but not on page `wp-admin/network/site-
 info.php`.

--

Comment (by sabernhardt):

 I edited the description's formatting and removed the last two parts.
 Please verify that that is correct :)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61026#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list