Commit Graph

73 Commits

Author SHA1 Message Date
Sergey Biryukov f9e52f8cd3 Docs: Synchronize `@return` descriptions for `::handle_row_actions()` methods in list tables.
Make sure `WP_Comments_List_Table::handle_row_actions()` and `WP_MS_Sites_List_Table::handle_row_actions()` return a string, for consistency with other classes.

See #49170, #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47059 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-11 17:56:15 +00:00
John James Jacoby 0a818ec0fc Network Admin: Improve Site States in List Table rows.
This commit switches a comparison to a Yoda condition, performs a more strict `intval()` check on the value of the Site Status column, and prevents a specific Site State from appearing in List Table rows when filtering by that same Site State already (to match the behavior of other List Table State implementations.)

Fixes #37684. Props pbiron.

git-svn-id: https://develop.svn.wordpress.org/trunk@46441 602fd350-edb4-49c9-b593-d223f7449a82
2019-10-08 17:44:42 +00:00
Dominik Schilling c7bd227390 Networks and Sites: Improve newly added strings for i18n.
* Remove unnecessary numbered placeholders.
* Add context to "All" and "Spam" status.
* Add translator comments.

Props pedromendonca.
Fixes #48210.

git-svn-id: https://develop.svn.wordpress.org/trunk@46385 602fd350-edb4-49c9-b593-d223f7449a82
2019-10-04 19:57:08 +00:00
Jonathan Desrosiers 2b076b7709 Coding Standards: Fix a coding standards issue introduced in [46254].
See #37392.

git-svn-id: https://develop.svn.wordpress.org/trunk@46261 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 18:33:10 +00:00
John James Jacoby 1c69792253 Multisite/Sites: supplemental commit to r46251.
This commit adds the links to the list-table class itself (that were missed in r46251.)

See #37392. Props pbiron, thomaswm.



git-svn-id: https://develop.svn.wordpress.org/trunk@46254 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 17:50:22 +00:00
Jonathan Desrosiers 8de962479d Docs: Add missing `$which` parameter descriptions.
Follow up of [46211].

See #45954.

git-svn-id: https://develop.svn.wordpress.org/trunk@46212 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 20:56:49 +00:00
Jonathan Desrosiers e31bd15ab5 Networks and Sites: Add support for the `extra_tablenav()` method in `WP_MS_Sites_List_Table`.
This method allows additional filters or other UI components to be added to the top and bottom of the `WP_List_Table` between the bulk actions dropdown and search input field.

Fixes #45954.
Props pbiron, desrosj.

git-svn-id: https://develop.svn.wordpress.org/trunk@46211 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 20:52:58 +00:00
John James Jacoby 7cbb1f32a3 Network Admin: Allow Sites to have filterable States in List Table rows.
This change introduces a new `site_states()` method to the Sites List Table class (with a new `display_site_states` filter inside of it) following the pattern popularized in other List Table classes before it (Posts, Media, etc...)

Fixes #37684. Props mnelson4, pbiron, jeremyfelt, johnjamesjacoby.

git-svn-id: https://develop.svn.wordpress.org/trunk@46153 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-16 23:33:45 +00:00
Sergey Biryukov 00b03f2a6f I18N: Capitalize translator comments consistently, add trailing punctuation.
Includes minor code layout fixes.

See #44360.

git-svn-id: https://develop.svn.wordpress.org/trunk@45932 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-03 00:39:13 +00:00
Sergey Biryukov a7513ac8e0 I18N: Improve translator comments.
* Add missing translator comments.
* Fix placement of some translator comments. Translator comments should be on the line directly above the line containing the translation function call for optimal compatibility with various `.pot` file generation tools. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translator comments.

Includes minor code layout fixes.

Polyglots, rejoice! All WordPress core files now have translator comments for all strings with placeholders!

Props jrf, subrataemfluence, GaryJ, webdados, Dency, swissspidy, alvarogois, marcomartins, mihaiiceyro, vladwtz, niq1982, flipkeijzer, michielatyoast, chandrapatel, thrijith, joshuanoyce, FesoVik, tessak22, bhaktirajdev, cleancoded, dhavalkasvala, garrett-eclipse, bibliofille, socalchristina, priyankkpatel, 5hel2l2y, adamsilverstein, JeffPaul, pierlo, SergeyBiryukov.
Fixes #44360.

git-svn-id: https://develop.svn.wordpress.org/trunk@45926 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-01 17:12:43 +00:00
SergeyBiryukov cb1d21191d Docs: Add missing description for `$wpdb`, `$wp_db_version`, and `$wp_current_db_version` globals.
Props mukesh27, utsav72640, immeet94, SergeyBiryukov.
See #45604.

git-svn-id: https://develop.svn.wordpress.org/trunk@45734 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-04 01:11:01 +00:00
Sergey Biryukov eba439f0ac Coding Standards: Remove extra whitespace in list tables' `column_cb()` methods.
See #47632.

git-svn-id: https://develop.svn.wordpress.org/trunk@45617 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-09 21:10:11 +00:00
Gary Pendergast 9a1549767e Coding Standards: Fix the `Squiz.PHP.DisallowMultipleAssignments` violations in `wp-admin`.
See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45583 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 12:50:14 +00:00
Gary Pendergast a75d153eee Coding Standards: Upgrade WPCS to 1.0.0
WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:
- Multiline function calls must now put each parameter on a new line.
- Auto-formatting files is now part of the `grunt precommit` script. 
- Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.



git-svn-id: https://develop.svn.wordpress.org/trunk@43571 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-17 01:50:26 +00:00
Felix Arntz 0a9c044283 Multisite: Count users in a more performant way when listing sites in the network admin.
Props spacedmonkey.
Fixes #44368.


git-svn-id: https://develop.svn.wordpress.org/trunk@43382 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-26 16:29:33 +00:00
John Blackbourn 58dd2c9559 Docs: Revert some sneaky debugging code.
See #41756


git-svn-id: https://develop.svn.wordpress.org/trunk@42872 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-22 20:28:42 +00:00
John Blackbourn f12dec95fe Docs: Document many more parameters and properties using typed array notation.
See #41756


git-svn-id: https://develop.svn.wordpress.org/trunk@42871 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-22 20:26:06 +00:00
Gary Pendergast 8f95800d52 Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42343 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-30 23:09:33 +00:00
John Blackbourn 8df2151660 General: Improve terminology used when referring to installations of WordPress and its extensions.
"Install" is not a noun, and while it might be acceptable to use the verb as a noun, it is not correct. Using the correct
noun, "installation", increases clarity, especially for non-native English speakers.

This change fixes the usage in user-facing text and in developer documentation.

Fixes #41620


git-svn-id: https://develop.svn.wordpress.org/trunk@41289 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-22 11:51:11 +00:00
Drew Jaynes bce1b14c9a Docs: Reduce confusion in `@since MU` notationss by indicating the WP version (3.0.0) the code was merged into core while retaining the original context.
Props sathyapulse.
Fixes #41509.


git-svn-id: https://develop.svn.wordpress.org/trunk@41200 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-01 20:43:25 +00:00
Drew Jaynes 829139ba1a Docs: Remove `@access` notations from method DocBlocks in wp-admin/* classes.
Prior to about 2013, many class methods lacked even access modifiers which made the `@access` notations that much more useful. Now that we've gotten to a point where the codebase is more mature from a maintenance perspective and we can finally remove these notations. Notable exceptions to this change include standalone functions notated as private as well as some classes still considered to represent "private" APIs.

See #41452.


git-svn-id: https://develop.svn.wordpress.org/trunk@41161 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-27 00:39:34 +00:00
Andrea Fercia 4f83e56f58 Administration: Fix some HTML validation errors.
Fixes some minor HTML issues in the admin and, most notably, changes the rel
attribute used in the List Tables from `rel="permalink"` to `rel="bookmark"`.

Props mihai2u, pento, arena, topher1kenobe, michalzuber, stubgo.
Fixes #37004.


git-svn-id: https://develop.svn.wordpress.org/trunk@40823 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-23 17:57:42 +00:00
John Blackbourn 49c68e7a9a Networks and Sites: Align the display of site statuses on the Sites listing screen with those of posts on the Posts listing screen.
Fixes #40290


git-svn-id: https://develop.svn.wordpress.org/trunk@40393 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-07 13:50:12 +00:00
Sergey Biryukov c248f03c61 Docs: Add description for `$mode` global in `WP_MS_Sites_List_Table` and `WP_MS_Users_List_Table`.
Fixes #40208.

git-svn-id: https://develop.svn.wordpress.org/trunk@40310 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-22 03:45:22 +00:00
Jeremy Felt 2979167ba7 Multisite: Use `get_network()` and `get_current_network_id()` for current network data.
`get_network()` falls back to the current network when called without any arguments. Between this and `get_current_network_id()`, we can replace almost all instances of the global `$current_site` and all instances of `get_current_site()`.

This effectively deprecates `get_current_site()`, something that we'll do in a future ticket.

Props flixos90.
Fixes #37414.


git-svn-id: https://develop.svn.wordpress.org/trunk@38814 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-19 04:46:14 +00:00
John Blackbourn 5cc963a721 Docs: Correct and clarify various `@since` docs.
Fixes #37562


git-svn-id: https://develop.svn.wordpress.org/trunk@38201 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-04 22:53:40 +00:00
Jeremy Felt 2e9bb996b9 Multisite: Add a `ms_sites_list_table_query_args` filter to `WP_MS_Sites_List_Table`.
This allows a developer to filter the arguments used to query sites during the `prepare_items()` method.

Props flixos90.
Fixes #26580.


git-svn-id: https://develop.svn.wordpress.org/trunk@37899 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 22:25:33 +00:00
Drew Jaynes bfdf00cb83 Docs: Add a missing summary and `@since` version to the DocBlock for `WP_MS_Sites_List_Table::prepare_items()`.
Also adds a changelog entry for 4.6.0 noting the changeover to `get_sites()`.

Fixes #36675. See #21837, #24833 and #33185.


git-svn-id: https://develop.svn.wordpress.org/trunk@37739 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-17 16:05:43 +00:00
Jeremy Felt 96d7eadb0c Multisite: Use `WP_Site_Query` to power `WP_MS_Sites_List_Table`.
`WP_Site_Query` provides for a cleaner `prepare_items()` method. It significantly improves the search experience in the sites list table:

* In a subdomain configuration, domain and path are searched for a provided terms.
* In a subdirectory configuration, path is searched for a provided term.
* The full domain is searched in a subdomain configuration rather than the portion not matching the network's domain.
* Terms are searched as `%term%` by default. Adding `*` in the middle of a term will search `%te%rm%`.

Props flixos90, Fab1en.
Fixes #33185, #24833, #21837, #36675.


git-svn-id: https://develop.svn.wordpress.org/trunk@37736 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-17 00:02:05 +00:00
Drew Jaynes 1cd420af5e Docs: Standardize hook docs in wp-admin/* to use third-person singular verbs per the inline documentation standards for PHP.
See #36913.


git-svn-id: https://develop.svn.wordpress.org/trunk@37488 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-22 18:00:23 +00:00
Sergey Biryukov 78391f6ebb I18N: Remove `<em>` tag from translatable string in `wp-admin/includes/class-wp-ms-sites-list-table.php`.
Props ramiy.
Fixes #35676.

git-svn-id: https://develop.svn.wordpress.org/trunk@36663 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-24 01:05:50 +00:00
Jeremy Felt a16d97039b Remove extra spaces between function names and brackets
These were introduced when making list table view modes sticky.

See #16774, #34365.


git-svn-id: https://develop.svn.wordpress.org/trunk@36572 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-18 16:50:49 +00:00
Jeremy Felt fafbd9fafd Multisite: Make view mode sticky for network users and sites list tables.
Fixes #34365.


git-svn-id: https://develop.svn.wordpress.org/trunk@36562 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-17 21:59:51 +00:00
ericlewis 3fde994152 Networks and sites: Replace "blog" usage with "site" in docs.
Multisite functions use the term "blog" to refer to what we now call a "site," e.g. `get_current_blog_id()`. These functions are here to stay because of our commitment to backwards compatibility. What we can do is set the documentation straight.

See #35417.


git-svn-id: https://develop.svn.wordpress.org/trunk@36416 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-28 03:34:02 +00:00
Drew Jaynes 5a0fd03f95 Docs: Add missing file headers to the list table classes and adjust class DocBlocks accordingly.
See #33701.


git-svn-id: https://develop.svn.wordpress.org/trunk@35241 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-17 15:12:48 +00:00
Jeremy Felt a8b5a8ec63 MS: Remove registration of ID column in Sites and Users list tables.
Reverts a portion of [34289] and leaves the render for the column behind. A plugin can register these fields for display via filter.

Fixes #18661.


git-svn-id: https://develop.svn.wordpress.org/trunk@34750 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 20:57:06 +00:00
Scott Taylor 2ddc438111 List Tables: when comparing string literals (non-numeric in nature) against vars, strict comparison can/should be used.
Props wonderboymusic, Viper007Bond.
Fixes #21249.


git-svn-id: https://develop.svn.wordpress.org/trunk@34383 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-22 06:05:39 +00:00
Sergey Biryukov 7851406626 Network Admin: Include IDs for users and sites on their respective views.
Props danielbachhuber, wonderboymusic.
Fixes #18661.

git-svn-id: https://develop.svn.wordpress.org/trunk@34289 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-18 15:57:47 +00:00
Jeremy Felt 4d2dbebb35 Multisite: Remove duplicate span element output from row actions
Fixes #32961.


git-svn-id: https://develop.svn.wordpress.org/trunk@33848 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-01 21:50:33 +00:00
Scott Taylor aee18d2d38 List Tables:
* In `->handle_row_actions()`, bail immediately if `$primary` and `$column_name` do not match. Saves us a nesting level and avoids declaring code that is unusable.
* In `WP_List_Table::single_row_columns()`, allow `_column_{$name}` to be called dynamically by core to avoid having to override the entirety of `->single_row_columns()` in `WP_MS_Users_List_Table` and `WP_Posts_List_Table`
* In `WP_MS_Sites_List_Table`, `id` is not a column.

Props wonderboymusic, paulwilde.
Fixes #29881.


git-svn-id: https://develop.svn.wordpress.org/trunk@33270 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-14 17:46:13 +00:00
Drew Jaynes 5251b3406a Add missing summaries, `@access` tags, and some parameter descriptions for methods added to `WP_MS_Sites_List_Table` in 4.3.
See [32755]. See #32891.


git-svn-id: https://develop.svn.wordpress.org/trunk@33199 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-13 17:52:43 +00:00
Jeremy Felt ca0aa3f19a Add better handling for actions and messaging in MS Sites List Table row actions
* Simplify URLs used for row actions to remove messaging and site domain/path.
* Use confirmation messaging from a managed list of actions when handling the request.
* Find the site address from the site ID rather than using information passed in the URL.

Fixes #32963.


git-svn-id: https://develop.svn.wordpress.org/trunk@33173 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-12 02:35:11 +00:00
Jeremy Felt 69239d86f9 Remove unused `$current_site` global in MS Sites list table
Found itself unused after [32719].

See #32434.


git-svn-id: https://develop.svn.wordpress.org/trunk@33097 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-06 22:50:59 +00:00
Helen Hou-Sandi e5c4c584c0 List tables: A better responsive view.
Instead of truncating columns, the data that's already in the markup can now be toggled into view. Only seems appropriate to celebrate four years of contributing by finally doing the first thing I ever mocked up.

Known issues / concerns:
* Custom list tables that don't define a primary column will show nothing at all. These are not extremely common, as `WP_List_Table` isn't really recommended for plugin consumption, but it happens. We need to come up with some kind of fallback.
* Some visual elements, particularly whitespace, could use refining.
* Needs a11y review.
* Touch performance on iOS feels sluggish - is there anything we can do about that?
* Would this be better accordion-style (only one expanded at a time)?
* Is `wp_strip_all_tags()` good enough for column titles that have HTML in them? It's essentially a workaround for the fact that core's comments column does that for the icon, which maybe it shouldn't. Perhaps worth another ticket, as a markup change would be fairly independent.
* Visual hierarchy is not great when expanded (also worthy of another ticket).
* Quick edit now becomes noticeably more annoying to cancel out of, as you have to scroll all the way down and you lose your position from before it was opened. Again, worthy of another ticket.

props Michael Arestad, helen.
see #32395.


git-svn-id: https://develop.svn.wordpress.org/trunk@33016 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-01 01:30:23 +00:00
Scott Taylor 1bae0bb006 Remove unused code from `WP_MS_Sites_List_Table::display_rows()`.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32938 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-25 16:35:51 +00:00
Scott Taylor ae8bd2bcd3 In `WP_MS_Sites_List_Table::display_rows()`:
* Move the giant `switch` statement into methods
* Call `->single_row_columns()`, which we now override - it could inherit from `WP_List_Table` if we can find a way to handle the `id` column. When that happens, we can ditch this method.

See #29881.


git-svn-id: https://develop.svn.wordpress.org/trunk@32755 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-13 16:23:01 +00:00
Helen Hou-Sandi c2ed5b170d List tables: Use a class instead of inline styles for hidden columns.
fixes #32608.


git-svn-id: https://develop.svn.wordpress.org/trunk@32724 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-10 19:46:39 +00:00
Jeremy Felt fc2ba19214 Additional improvement to sites list table display
* Build `$blogname` identically when creating action link messaging.
* Remove the trailing slash from URLs for a better UI.

See #32434.


git-svn-id: https://develop.svn.wordpress.org/trunk@32719 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-10 07:27:09 +00:00
Jeremy Felt 9170edb2b2 Improve information displayed in a network's sites list table
* Better support for arbitrary domain/path combinations by displaying the URL in the primary column rather than Path or Domain.
* Show a cached count of total users per site as a more useful data point rather than the first 5 users.
* Clear that cached count of users for a site when a user is added to the site via `add_user_to_blog()`.

Props @ocean90.
Fixes #32434.


git-svn-id: https://develop.svn.wordpress.org/trunk@32718 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-10 06:49:38 +00:00
Drew Jaynes 78e56cd89b Fix formatting and add missing return descriptions for inline documentation introduced in [32644] for `WP_MS_Sites_List_Table`.
See #25408. See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@32664 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-31 01:33:40 +00:00