Commit Graph

60 Commits

Author SHA1 Message Date
Sergey Biryukov
af1a737b48 Coding Standards: Fix WPCS indentation issue in wp-admin/includes/class-wp-links-list-table.php.
This was causing a `Generic.WhiteSpace.ScopeIndent.IncorrectExact` error if PHP_CodeSniffer 3.4.1 or newer is installed locally, despite the task passing on Travis.

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


git-svn-id: http://core.svn.wordpress.org/trunk@47370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-04-17 18:31:07 +00:00
Sergey Biryukov
2294d65753 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.
Built from https://develop.svn.wordpress.org/trunk@47059


git-svn-id: http://core.svn.wordpress.org/trunk@46859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-11 17:59:04 +00:00
Sergey Biryukov
6e8f550770 General: Correct strict comparison in WP_Links_List_Table::column_categories() introduced in [46313].
`$cat_id` is a string, `$category` is an integer.

See #48142.
Built from https://develop.svn.wordpress.org/trunk@46316


git-svn-id: http://core.svn.wordpress.org/trunk@46115 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-26 01:24:56 +00:00
whyisjake
a351243928 General: Further phpcs cleanup.
In [46312] and [46313] we attempted to do some phpcs cleanup. This commit cleans up three issues that were introduced in [46309].

Fixes #48142.

Props: whyisjake, garrett-eclipse, desrosj

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


git-svn-id: http://core.svn.wordpress.org/trunk@46113 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-26 00:37:58 +00:00
whyisjake
d53b773a47 General: Further phpcs cleanup.
In [46312] we attempted to do some `phpcs` cleanup. This commit cleans up three issues that were introduced in [46309].

Fixes #48142.
Props whyisjake, garrett-eclipse.

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


git-svn-id: http://core.svn.wordpress.org/trunk@46112 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-25 23:38:57 +00:00
whyisjake
38dc032e66 General: Linter cleanup
`phpcbf` was able to clean up a few files. Tests were breaking as a result of code formatting.

Fixes #48142
Props whyisjake

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


git-svn-id: http://core.svn.wordpress.org/trunk@46111 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-25 22:53:58 +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
7369ff02f5 Coding Standards: Remove extra whitespace in list tables' column_cb() methods.
See #47632.
Built from https://develop.svn.wordpress.org/trunk@45617


git-svn-id: http://core.svn.wordpress.org/trunk@45428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-09 21:11:58 +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
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
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
Sergey Biryukov
c957321007 Docs: Correct @global entry for $cat_id in WP_Links_List_Table::column_categories().
Props tejas5989.
Fixes #41436.
Built from https://develop.svn.wordpress.org/trunk@41147


git-svn-id: http://core.svn.wordpress.org/trunk@40987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-25 13:19: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
Sergey Biryukov
1dc98b2e49 Taxonomy: Remove unnecessary 'All categories' string on Edit Posts and Edit Links screens and use taxonomy's all_items label instead.
Props johnbillion.
Fixes #36049.
Built from https://develop.svn.wordpress.org/trunk@36808


git-svn-id: http://core.svn.wordpress.org/trunk@36775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-02 22:14:25 +00:00
Andrea Fercia
cc58c4a940 Link Manager: Fix usage of translation functions after [35998].
Uses `printf()` instead, adds translator comment.

Fixes #35135.
Built from https://develop.svn.wordpress.org/trunk@36792


git-svn-id: http://core.svn.wordpress.org/trunk@36759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-29 23:26:26 +00:00
Andrea Fercia
e8b900d9f5 Accessibility: Remove title attributes from the Link Manager screen.
Title attributes are now replaced with `aria-label` where appropriate.
Also fixes some typos in the DocBlocks.

Fixes #35135.
Built from https://develop.svn.wordpress.org/trunk@35998


git-svn-id: http://core.svn.wordpress.org/trunk@35963 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-17 22:53:28 +00:00
Drew Jaynes
8a386cb24f Docs: Add missing file headers to the list table classes and adjust class DocBlocks accordingly.
See #33701.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-17 15:13:25 +00:00
Scott Taylor
4d34e37311 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33242 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-14 17:47:24 +00:00
Drew Jaynes
d1a3d2e6ea Add missing summaries, @access tags, and some parameter descriptions for methods added to WP_Links_List_Table in 4.3.
See [32753]. See #32891.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-13 18:03:24 +00:00
Scott Taylor
5c6b63d3a6 if is a statment, not a function.
See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-16 20:01:25 +00:00
Scott Taylor
a56576edfe In WP_Links_List_Table::display_rows():
* Move the giant `switch` statement into methods
* Call `-single_row_columns()`, which it inherits from `WP_List_Table`

See #29881.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-13 15:33:25 +00:00
Helen Hou-Sandí
c87224eaf6 List tables: Use a class instead of inline styles for hidden columns.
fixes #32608.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-10 19:47:27 +00:00
Drew Jaynes
8bcf53cc68 Fix formatting and add missing return descriptions for inline documenation introduced in [32644] for WP_List_Table.
Also fixes an error introduced in [32661] for `WP_Links_List_Table`.

See #25408. See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-31 01:29:26 +00:00
Drew Jaynes
2a0048b1fb Fix formatting and add a missing return description for inline documentation introduced in [32644] for WP_Links_List_Table.
See #25408. See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-31 01:23:26 +00:00
Scott Taylor
6a08b00632 Add @access annotations to methods that have no doc block in wp-admin/includes/*.
Makes it easier to search for no doc blocks via `}[\n\t\r ]+(protected|private|public)`.

See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 21:32:24 +00:00
Scott Taylor
c6a4512b1b Add missing doc blocks to wp-admin/includes/*.
Fix some egregious uses of tabbing.
Some functions can simply return `apply_filters(...)` instead of setting a variable that is immediately returned.

See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 20:17:26 +00:00
Helen Hou-Sandí
4c0c7fd7ba List tables: introduce the concept of a "primary" column.
This becomes the column that contains the row actions, and allows for a more flexibility, particularly with custom post types and list tables. To (re)define the primary column, use the `list_table_primary_column` filter, which receives the column name and the screen ID as arguments.

props stephdau, DaveAl, jesin.
see #25408.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 02:41:25 +00:00
Scott Taylor
b56b9b3e5c Add @global annotations for wp-admin/*.
See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-28 21:41:30 +00:00
Helen Hou-Sandí
62a197d6bf List tables: Use CSS :nth-child() selectors for zebra striping.
Note that this does not fix issues related to comment quick edit. Internal linking also continues to use the `.alternate` class for now. IE8 and below gracefully degrade by not having zebra striping.

There is some hoop jumping with adding an extra table row to maintain zebra striping during quick edit. Documenting that here for future reference; it is also in the inline documentation.

fixes #30981 and #26060. see #25060.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-14 22:14:22 +00:00
John Blackbourn
bdd00b3902 Improve various hook and filter docs so they are correctly parsed for the code reference.
Fixes #30558
Props DrewAPicture

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


git-svn-id: http://core.svn.wordpress.org/trunk@30744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-06 21:32:24 +00:00
Sergey Biryukov
f013b7e64b Remove "View" prefix from category filter dropdowns, for consistency with [27626].
props afercia.
see #29921.
Built from https://develop.svn.wordpress.org/trunk@29871


git-svn-id: http://core.svn.wordpress.org/trunk@29630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-11 02:23:18 +00:00
Sergey Biryukov
2c0947eeee Add missing labels to category filter dropdowns.
props afercia.
fixes #29921.
Built from https://develop.svn.wordpress.org/trunk@29870


git-svn-id: http://core.svn.wordpress.org/trunk@29629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-11 02:21:19 +00:00
Andrew Nacin
f7392ef917 Pinking shears.
Built from https://develop.svn.wordpress.org/trunk@29707


git-svn-id: http://core.svn.wordpress.org/trunk@29481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-04 15:23:16 +00:00
Drew Jaynes
d60a081137 Add @access tags to constructor docblocks in list table classes.
See #28679. See [29459].

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


git-svn-id: http://core.svn.wordpress.org/trunk@29238 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-10 02:22:16 +00:00
Drew Jaynes
8e86454467 Document default arguments for the WP_List_Table class. Also add referenced docblocks to extending class constructors.
Props mikejolley for the initial patch.
Fixes #28679. See #28298.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-10 02:18:17 +00:00
Scott Taylor
176b9b2301 Fix mismatches in access modifiers for WP_List_Table + subclasses.
Fixes #28843, #28879.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-13 22:09:16 +00:00
Scott Taylor
40725e9e67 Repent for our original OOP sins and doc blocks as pertains to access modifiers in List Table + subclasses.
Props SergeyBiryukov.
See #28843 and [28583].

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


git-svn-id: http://core.svn.wordpress.org/trunk@28904 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-12 03:27:14 +00:00
Sergey Biryukov
5f0b156155 Prevent bulk actions from being performed when Filter button is clicked.
props jesin.
fixes #28555.
Built from https://develop.svn.wordpress.org/trunk@28916


git-svn-id: http://core.svn.wordpress.org/trunk@28715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-30 01:10:15 +00:00
Scott Taylor
d28f6344de Add access modifiers to methods and members of list table classes:
* `WP_List_Table` is the base class that implements `__get()` and `__call()` for BC
* Adds unit tests to confirm that subclasses properly inherit magic methods
* Add modifiers to subclasses: `WP_Links_List_Table`, `WP_Media_List_Table`, `WP_MS_Sites_List_Table`, `WP_MS_Themes_List_Table`, `WP_MS_Users_List_Table`, `WP_Plugin_Install_List_Table`, `WP_Plugins_List_Table`, `WP_Posts_List_Table`, `WP_Terms_List_Table`, `WP_Theme_Install_List_Table`, `WP_Themes_List_Table`

See #27881, #22234.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-19 01:17:15 +00:00
Andrew Ozz
eb1d21d782 Remove all "valign" attributes from tables in wp-admin, props MikeHansenMe, Marventus. Fixes #22712.
Built from https://develop.svn.wordpress.org/trunk@27029


git-svn-id: http://core.svn.wordpress.org/trunk@26905 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-01-24 19:06:15 +00:00
Drew Jaynes
f82f00a453 Inline documentation for hooks in wp-admin/includes/class-wp-links-list-table.php.
Props JoshuaAbenazer, kpdesign.
Fixes #26052.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-23 21:28:11 +00:00
Andrew Nacin
83e0ce2ac1 Remove unused variables reset by wp_reset_vars(). Many of these haven't been used since b2. see #21767.
git-svn-id: http://core.svn.wordpress.org/trunk@23445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-16 18:28:41 +00:00
Andrew Nacin
c1b0670c2d Updates and fixes to the new button styles. By default, buttons are now the same size as they were in 3.4. Then there is a smaller button (designed for minor elements) and a larger button (designed for things like Publish and Save Changes). Better focus styles. props lessbloat. see #21598.
git-svn-id: http://core.svn.wordpress.org/trunk@21944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-21 19:34:23 +00:00
Ryan Boren
a3cfe28527 Reduce reliance on global variables in the list tables. Allow passing a screen ID to the list tables so that ajax handlers can set the needed screen.
Props nacin
fixes #21871


git-svn-id: http://core.svn.wordpress.org/trunk@21914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-19 12:43:31 +00:00
Daryl Koopersmith
67894a3407 New button styles.
Using the new buttons:

* Button classes are now stackable.
* All buttons should use a base class of "button".
* Buttons default to the gray style (formerly "button-secondary"). Buttons can add a style by adding additional classes. To make a primary button, add the "button-primary" class.
* Buttons can be rendered in various sizes. In addition to the default size, you can add "button-large", "button-small", or "button-tiny".

For backwards compatibility reasons, "button-primary" and "button-secondary" both work as standalone classes.

get_submit_button() has been adjusted to handle shorthand button classes (i.e. button classes can be passed without the "button-" prefix).

props lessbloat, helenyhou, trepmal, nacin. see #21598.



git-svn-id: http://core.svn.wordpress.org/trunk@21789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-08 04:58:34 +00:00
ryan
73addbbd24 More screen reader text for list table checkboxes and theme install search. Props MikeLittle, SergeyBiryukov. see #21325
git-svn-id: http://core.svn.wordpress.org/trunk@21323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-25 16:18:14 +00:00
ryan
c36145c9aa Add screen reader text to checkboxes in list tables. Props MikeLittle, nacin. see #21325
git-svn-id: http://core.svn.wordpress.org/trunk@21317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-24 18:01:22 +00:00
ryan
e3b46b25d3 Lose EOF ?>. Clean up EOF newlines. fixes #12307
git-svn-id: http://svn.automattic.com/wordpress/trunk@19712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-08 17:01:11 +00:00
azaozz
12dd9113cb Add context to _e('Name'), props valentinas, fixes #16531
git-svn-id: http://svn.automattic.com/wordpress/trunk@18247 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-06-10 22:13:26 +00:00