Commit Graph

227 Commits

Author SHA1 Message Date
Sergey Biryukov
b16368c268 Docs: Remove @staticvar tags from core.
The tag was supported in phpDocumentor 1.x, but is no longer supported in 2.x and 3.x.

Usage of static variables is considered an internal implementation detail and has no information value for someone reading the docs.

Props alishanvr, jrf.
Fixes #50426.
Built from https://develop.svn.wordpress.org/trunk@48109


git-svn-id: http://core.svn.wordpress.org/trunk@47878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-20 12:40:12 +00:00
Sergey Biryukov
e13c363b17 Docs: Capitalize "ID", when referring to a post ID, term ID, etc. in a more consistent way.
See #49572.
Built from https://develop.svn.wordpress.org/trunk@48104


git-svn-id: http://core.svn.wordpress.org/trunk@47873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-20 12:02:12 +00:00
whyisjake
28d29b35f7 Comments: Don't display edit links to trashed post comments.
If a post is in the trash, the comments bubble won't link to the comments list.

Fixes: #37826.
Props: swissspidy, helen, FolioVision, DrewAPicture, stevenlinx, donmhico, birgire, garrett-eclipse, andraganescu, johnbillion. 



Built from https://develop.svn.wordpress.org/trunk@48050


git-svn-id: http://core.svn.wordpress.org/trunk@47817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-15 23:06:08 +00:00
Adam Silverstein
0b9a800512 Media: remove any attachment-filter query param when switching views.
Fix an issue where the media attachment filter no longer worked after switching to list view, filtering by a media type then switching back to the grid view.

Props itzmekhokan, netsurfer2705, zodiac1978.
Fixes #43656.


Built from https://develop.svn.wordpress.org/trunk@47915


git-svn-id: http://core.svn.wordpress.org/trunk@47689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-05 21:13:10 +00:00
Sergey Biryukov
38676936ba Coding Standards: Use strict type check for in_array() and array_search() where strings are involved.
This reduces the number of `WordPress.PHP.StrictInArray.MissingTrueStrict` issues from 486 to 50.

Includes minor code layout fixes for better readability.

See #49542.
Built from https://develop.svn.wordpress.org/trunk@47550


git-svn-id: http://core.svn.wordpress.org/trunk@47325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-04-05 03:02:11 +00:00
Sergey Biryukov
641c632b0c Coding Standards: Use Yoda conditions where appropriate.
See #49222.
Built from https://develop.svn.wordpress.org/trunk@47219


git-svn-id: http://core.svn.wordpress.org/trunk@47019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-09 16:55:09 +00:00
Sergey Biryukov
001ffe81fb Docs: Improve inline comments per the documentation standards.
Includes minor code layout fixes for better readability.

See #48303.
Built from https://develop.svn.wordpress.org/trunk@47122


git-svn-id: http://core.svn.wordpress.org/trunk@46922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-29 00:45:18 +00:00
Sergey Biryukov
d469aa8162 Docs: Correct @return description for WP_List_Table::handle_row_actions().
Props pbiron.
Fixes #49170.
Built from https://develop.svn.wordpress.org/trunk@47058


git-svn-id: http://core.svn.wordpress.org/trunk@46858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-11 17:57:03 +00:00
John Blackbourn
aa1fdcbd52 Docs: Correct various docblocks documentation.
See #48303
Built from https://develop.svn.wordpress.org/trunk@46821


git-svn-id: http://core.svn.wordpress.org/trunk@46621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-12-06 22:23:04 +00:00
Andrea Fercia
71725aeb95 Accessibility: Add an aria-current attribute to the Media Library switch links.
The `aria-current` attribute is a simple, effective, way to help assistive technology users orientate themselves within a set of items.

Props mayanksonawat, afercia.
Fixes #48271.

Built from https://develop.svn.wordpress.org/trunk@46746


git-svn-id: http://core.svn.wordpress.org/trunk@46546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-11-18 16:51:02 +00:00
Sergey Biryukov
418db0297e Docs: Correct spelling of "subclass" and "overridden" in various docblocks and error messages.
Props garrett-eclipse.
Fixes #48676.
Built from https://develop.svn.wordpress.org/trunk@46739


git-svn-id: http://core.svn.wordpress.org/trunk@46539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-11-17 07:43:01 +00:00
John Blackbourn
eda6a9e111 Docs: Docs on docs. Further improve documentation of known return types, plus other docs fixes.
See #48303

Built from https://develop.svn.wordpress.org/trunk@46662


git-svn-id: http://core.svn.wordpress.org/trunk@46462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-11-05 21:30:03 +00:00
John Blackbourn
057f661ce3 Docs: Miscellaneous docblock corrections.
See #48303

Built from https://develop.svn.wordpress.org/trunk@46610


git-svn-id: http://core.svn.wordpress.org/trunk@46407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-28 19:48:01 +00:00
Sergey Biryukov
5f2c7142a1 Docs: Improve documentation for ::display() methods in various list tables.
Props itowhid06.
Fixes #47947.
Built from https://develop.svn.wordpress.org/trunk@46341


git-svn-id: http://core.svn.wordpress.org/trunk@46140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-29 11:04:58 +00:00
Sergey Biryukov
e6bbff13c5 Code Modernisation: Replace call_user_func_array() in various __call() methods with dynamic function calls.
The callback in these functions is always checked against a limited list of valid callbacks that can be safely changed to dynamic function calls.

Props jrf.
See #47678.
Built from https://develop.svn.wordpress.org/trunk@46144


git-svn-id: http://core.svn.wordpress.org/trunk@45956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:53:56 +00:00
Sergey Biryukov
e199663322 I18N: Capitalize translator comments consistently, add trailing punctuation.
Includes minor code layout fixes.

See #44360.
Built from https://develop.svn.wordpress.org/trunk@45932


git-svn-id: http://core.svn.wordpress.org/trunk@45743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-03 00:41:05 +00:00
Sergey Biryukov
16b8d91baa 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.
Built from https://develop.svn.wordpress.org/trunk@45926


git-svn-id: http://core.svn.wordpress.org/trunk@45737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-01 17:13:59 +00:00
Sergey Biryukov
e0311b76c7 Docs: Add missing description for $wp_locale global.
Props mukesh27.
See #45604, #47110.
Built from https://develop.svn.wordpress.org/trunk@45737


git-svn-id: http://core.svn.wordpress.org/trunk@45548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-04 01:46:55 +00:00
Sergey Biryukov
29b072e706 Docs: Add missing description for $wpdb, $wp_db_version, and $wp_current_db_version globals.
Props mukesh27, utsav72640, immeet94, SergeyBiryukov.
See #45604.
Built from https://develop.svn.wordpress.org/trunk@45734


git-svn-id: http://core.svn.wordpress.org/trunk@45545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-04 01:12:56 +00:00
Gary Pendergast
a02b5cc2a8 Coding Standards: Mark the handful of hook names with uppercase characters or hyphens as ignored.
See #47632.


Built from https://develop.svn.wordpress.org/trunk@45599


git-svn-id: http://core.svn.wordpress.org/trunk@45410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-05 01:45:56 +00:00
Gary Pendergast
cf3fa9f7c8 Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-admin.
See #47632.


Built from https://develop.svn.wordpress.org/trunk@45583


git-svn-id: http://core.svn.wordpress.org/trunk@45394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-01 12:52:01 +00:00
Gary Pendergast
7a617078fa Coding Standards: Upgrade WPCS to 1.2.1.
This upgrade fixes quite a few false positives, as well as auto-fixing some indenting issues.

Fixes #45956.


Built from https://develop.svn.wordpress.org/trunk@44574


git-svn-id: http://core.svn.wordpress.org/trunk@44405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-12 06:41:52 +00:00
Gary Pendergast
56c162fbc9 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.


Built from https://develop.svn.wordpress.org/trunk@43571


git-svn-id: http://core.svn.wordpress.org/trunk@43400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-08-17 01:51:36 +00:00
Andrea Fercia
8d9f1ae0d5 Accessibility: Better color contrast for the tables pagination links.
By making the pagination links use the default style for buttons, color contrast
is improved and the CSS is simplified. Improves consistency with other UI controls.
Also, slightly increases the white space below the pagination links.

Props benoitchantre, afercia.
Fixes #41858.

Built from https://develop.svn.wordpress.org/trunk@43019


git-svn-id: http://core.svn.wordpress.org/trunk@42848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-04-29 16:25:21 +00:00
John Blackbourn
1b5d6c6971 Docs: Document many more parameters and properties using typed array notation.
See #41756

Built from https://develop.svn.wordpress.org/trunk@42871


git-svn-id: http://core.svn.wordpress.org/trunk@42701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-03-22 20:27:32 +00:00
Gary Pendergast
aaf99e6913 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.


Built from https://develop.svn.wordpress.org/trunk@42343


git-svn-id: http://core.svn.wordpress.org/trunk@42172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-30 23:11:00 +00:00
John Blackbourn
67c973f95e Docs: Correct parameter type documentation for various __call() methods.
See #42505

Built from https://develop.svn.wordpress.org/trunk@42151


git-svn-id: http://core.svn.wordpress.org/trunk@41982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-10 22:56:47 +00:00
Drew Jaynes
1a28ec87e1 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.

Built from https://develop.svn.wordpress.org/trunk@41161


git-svn-id: http://core.svn.wordpress.org/trunk@41001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 00:40:43 +00:00
Andrea Fercia
b8e2496645 Administration: in WP_List_Table->pagination(), properly concatenate CSS classes for the pagination links when infinite_scroll is set to true.
Props SGr33n.
See #19815.
Fixes #40003.

Built from https://develop.svn.wordpress.org/trunk@41019


git-svn-id: http://core.svn.wordpress.org/trunk@40869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-09 11:12:43 +00:00
Sergey Biryukov
165807d39f Administration: In WP_List_Table::comments_bubble(), replace the mdash with its HTML entity for consistency with the similar code in other list tables.
Props afercia.
See #40659, #32152.
Built from https://develop.svn.wordpress.org/trunk@40960


git-svn-id: http://core.svn.wordpress.org/trunk@40810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-29 00:04:43 +00:00
John Blackbourn
4548b08236 General: Use interpolation instead of concatenation for all dynamic hook names.
This fixes the rendering of the hook names on developer.wordpress.org.

Props keesiemeijer
Fixes #39148

Built from https://develop.svn.wordpress.org/trunk@39600


git-svn-id: http://core.svn.wordpress.org/trunk@39540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-14 04:18:42 +00:00
Andrea Fercia
eeefec932f Administration: Improve the usage of the button CSS classes.
Introduces some consistency in the usage of the button CSS classes, fixes the
focus style for accessibility and responsiveness of the buttons.

- Adds the `button` class to all primary buttons make them responsive
- Removes all `secondary-button` classes and replaces it with button when needed. `button-secondary` shouldn't be used and exists just for backward compatibility reasons
- Replaces classes inside `submit_button()` with a shorthand for some buttons, and use an empty string for the default `button` class. Passing `button` is unnecessary
- Adjusts `get_submit_button()` to remove empty items

Props iseulde, dimchik, chris_d2d, mhowell, afercia.
Fixes #27314, #37138, #37448.

Built from https://develop.svn.wordpress.org/trunk@38672


git-svn-id: http://core.svn.wordpress.org/trunk@38615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-28 19:54:28 +00:00
Eric Lewis
d27606936b Allow custom bulk actions in admin list tables.
Bulk action filtering was introduced in 3.1, but only to remove default bulk actions, not add new ones.

Bulk actions can now be registered for all admin list table dropdowns via the `bulk_actions-{get_current_screen()->id}` filter. Handling custom bulk actions can be performed in the corresponding and newly introduced `handle_bulk_actions-${get_current_screen()->id}` filter.

Props scribu, flixos90, Veraxus.
See #16031.


Built from https://develop.svn.wordpress.org/trunk@38647


git-svn-id: http://core.svn.wordpress.org/trunk@38590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-23 20:33:30 +00:00
Scott Taylor
b7812bd416 AJAX: add a new function, wp_doing_ajax(), which can replace... (wait for it...) DOING_AJAX checks via the constant.
Props Mte90, sebastian.pisula, swissspidy.
Fixes #25669.

Built from https://develop.svn.wordpress.org/trunk@38334


git-svn-id: http://core.svn.wordpress.org/trunk@38275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-23 14:33:30 +00:00
Dominik Schilling
51671afc0a List Table: Improve WP_Plugins_List_Table::search_box() which was added in [38033].
* Update DocBlock to use third-person singular verb and to include a period at the end.
* Use `submit_button()` for the submit button.
* Escape the ID attribute.
* Apply the same to `WP_List_Table::search_box()`.

See #37230.
Built from https://develop.svn.wordpress.org/trunk@38146


git-svn-id: http://core.svn.wordpress.org/trunk@38087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-23 11:00:36 +00:00
Drew Jaynes
6c7148943b Docs: Standardize capitalization of Ajax throughout core documentation per the core spelling guide.
Ajax, while considered an acronym for Asynchronous JavaScript and XML, is most commonly capitalized only in the first character.

Part props ocean90.
See #32246.

Built from https://develop.svn.wordpress.org/trunk@38028


git-svn-id: http://core.svn.wordpress.org/trunk@37969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-10 00:51:30 +00:00
Andrea Fercia
809ad6e429 List tables: Make the pagination links and text better responsive.
On small screens, especially with longer translations, the pagination links and
text could break in two lines. This fixes it moving down the text in a new line.

Fixes #33962.
Built from https://develop.svn.wordpress.org/trunk@37912


git-svn-id: http://core.svn.wordpress.org/trunk@37853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-29 13:30:28 +00:00
Rachel Baker
445b9b6d94 Users: Stop WP_List_Table notices from persisting on pagination navigation.
Adds the keyboard navigation query vars to `wp_removable_query_args()` and passes the results of said function to remove_query_var() inside the WP_List_Table pagination method.

Props EFAREM for the initial patch.
Fixes #35620.
Built from https://develop.svn.wordpress.org/trunk@37663


git-svn-id: http://core.svn.wordpress.org/trunk@37629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-09 01:56:27 +00:00
Drew Jaynes
c3055cc190 Docs: Standardize hook docs in wp-admin/* to use third-person singular verbs per the inline documentation standards for PHP.
See #36913.

Built from https://develop.svn.wordpress.org/trunk@37488


git-svn-id: http://core.svn.wordpress.org/trunk@37456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-22 18:01:30 +00:00
Drew Jaynes
b1804afeaf Docs: Standardize on 'backward compatibility/compatible' nomenclature in core inline docs.
Also use 'back-compat' in some inline comments where backward compatibility is the subject and shorthand feels more natural.

Note: 'backwards compatibility/compatibile' can also be considered correct, though it's primary seen in regular use in British English.

Props ocean90.
Fixes #36835.

Built from https://develop.svn.wordpress.org/trunk@37431


git-svn-id: http://core.svn.wordpress.org/trunk@37397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-13 18:41:31 +00:00
Drew Jaynes
fe3b007fdd Docs: Remove inline @see tags from function, class, and method references in inline docs.
Known functions, classes, and methods are now auto-linked in Code Reference pages following #meta1483.

Note: Hook references are still linked via inline `@see` tags due to the unlikelihood of reliably matching for known hooks based on a RegEx pattern.

See #32246.

Built from https://develop.svn.wordpress.org/trunk@37342


git-svn-id: http://core.svn.wordpress.org/trunk@37308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-02 04:00:28 +00:00
Dominik Schilling
3c0c5e6ad5 List Tables: Revert [34728] and [35482].
Part of [34728] was already reverted in [35682], but the default values still made it impossible to set a default ordering for custom post types.

See #25493.
See #34825.
Built from https://develop.svn.wordpress.org/trunk@35818


git-svn-id: http://core.svn.wordpress.org/trunk@35782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-07 19:16:26 +00:00
Konstantin Kovshenin
84affbd3a9 Docs: Make "list table table tag" a bit more readable.
See: #34885, r35796.

Built from https://develop.svn.wordpress.org/trunk@35797


git-svn-id: http://core.svn.wordpress.org/trunk@35761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-06 21:54:26 +00:00
Konstantin Kovshenin
919867b090 Docs: Remove some more dittography.
See #34885, r35793.

Built from https://develop.svn.wordpress.org/trunk@35796


git-svn-id: http://core.svn.wordpress.org/trunk@35760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-06 21:50:25 +00:00
Scott Taylor
a99f7baa5a List Tables: Fix PHP error notice when $columns is null
Use of `register_column_headers()` and `print_column_headers()` creates a `_WP_List_Table_Compat` without any columns. When the List Table object doesn't have any columns, there's naturally no primary column.

Props danielbachhuber.
Fixes #34148.

Built from https://develop.svn.wordpress.org/trunk@35698


git-svn-id: http://core.svn.wordpress.org/trunk@35662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-18 23:01:26 +00:00
Scott Taylor
7a24b60c2a List Tables: to ensure that get_primary_column_name() can match columns that were added via the "manage_{$screen->id}_columns" filer, call get_column_headers() instead of $this->get_columns().
List Table classes and `WP_Screen` are already tangled together. The parent list table constructor adds a filter that is called by a function that references the instance globally, even though we have access to it via composition directly in the class that is adding the filter. So the fact that functions here have to be called that reference a screen instance we already have access to is what one might call... less than elegant.

#OOP

Props SergeyBiryukov.
Fixes #34508.

Built from https://develop.svn.wordpress.org/trunk@35565


git-svn-id: http://core.svn.wordpress.org/trunk@35529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-07 15:27:25 +00:00
Sergey Biryukov
f43a25bbe1 Docs: After [32654], remove duplicate @param tag in WP_List_Table::set_pagination_args() DocBlock.
Add `@since` tag.

Props bobbingwide.
See #32444.
Built from https://develop.svn.wordpress.org/trunk@35489


git-svn-id: http://core.svn.wordpress.org/trunk@35453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-02 21:03:24 +00:00
Drew Jaynes
10d94ea673 Docs: Add a missing file header for wp-admin/includes/class-wp-list-table.php.
See #33701.

Built from https://develop.svn.wordpress.org/trunk@35237


git-svn-id: http://core.svn.wordpress.org/trunk@35203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-17 06:07:24 +00:00
Drew Jaynes
fb2a4bf9fb Docs: Fix some syntactical issues in property DocBlocks for WP_List_Table.
See #32246.

Built from https://develop.svn.wordpress.org/trunk@35021


git-svn-id: http://core.svn.wordpress.org/trunk@34986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-11 03:34:26 +00:00
Scott Taylor
0c2b2a0e3d List Tables/WP_Screen: in WP_Screen, add methods to store, retrieve, and render screen reader text, primarily used by list table screens.
These additions are based on an audit and recommendations by the Accessibility team. #a11y'all

Props afercia.
Fixes #32147.

Built from https://develop.svn.wordpress.org/trunk@34891


git-svn-id: http://core.svn.wordpress.org/trunk@34856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 01:28:25 +00:00