Commit Graph

96 Commits

Author SHA1 Message Date
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
677c2a447b Media: Update the media bulk action labels for consistency.
Props ianbelanger, garrett-eclipse, afercia, Presskopp.
Fixes #44675.



git-svn-id: https://develop.svn.wordpress.org/trunk@45147 602fd350-edb4-49c9-b593-d223f7449a82
2019-04-08 23:53:02 +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
Sergey Biryukov
31ed6e771e Privacy: Move "Mine" filter for media items above "Trash".
See #43820.

git-svn-id: https://develop.svn.wordpress.org/trunk@43063 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-01 21:46:52 +00:00
Sergey Biryukov
0c848f5503 I18N: Add context for "Mine" string added in [43056].
See #43820.

git-svn-id: https://develop.svn.wordpress.org/trunk@43062 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-01 21:36:41 +00:00
Andrew Ozz
7f6f84606f Privacy: add "Mine" filter for media similarly to posts and comments.
Props audrasjb.
See #43820.

git-svn-id: https://develop.svn.wordpress.org/trunk@43056 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-01 15:42:38 +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
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
Sergey Biryukov
43a27ede8f Docs: Add description for $mode global in WP_Media_List_Table and WP_Posts_List_Table.
See #40208.

git-svn-id: https://develop.svn.wordpress.org/trunk@40309 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-22 03:44:51 +00:00
Pascal Birchler
11d556e42b List Tables: Hide 'Empty Trash' and 'Empty Spam' buttons when view is already empty.
Props ivantedja, Presskopp, printsachen1, Jaydeep Rami, mathieuhays, cazm.
Fixes #38341.

git-svn-id: https://develop.svn.wordpress.org/trunk@40297 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-17 16:53:08 +00:00
Sergey Biryukov
15346053d6 List Tables: Pass the $which parameter to restrict_manage_posts filter instance in WP_Media_List_Table, missed in [37422].
Props wpsmith.
Fixes #38772.

git-svn-id: https://develop.svn.wordpress.org/trunk@39917 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-17 02:37:14 +00:00
Andrea Fercia
7ce67a141d Administration: Better consistency for the Media, Add Plugins, and Add Themes toolbars.
Fixes the Add Themes toolbar padding. Standardizes the placeholders to no title
case and three trailing dots. Expands the Media search placeholder in
"Search media items..." for consistency with the Plugins and Themes toolbars.

Props mikeviele, jamesacero, mattking5000, koenschipper, dungengronovius.

Fixes #38010.


git-svn-id: https://develop.svn.wordpress.org/trunk@38795 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-14 21:32:08 +00:00
Andrea Fercia
ee7f970ffa 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38672 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-28 19:53:07 +00:00
Dominik Schilling
310d406274 Accessibility: Add aria-button-if-js class to links in the media list table that behave like buttons when JavaScript is on.
Props joedolson, afercia.
See #26504.
Fixes #36555.

git-svn-id: https://develop.svn.wordpress.org/trunk@38031 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-10 19:30:20 +00:00
Sergey Biryukov
f7c680e84f Media: Avoid PHP notices when trying to show a parent post title of an orphaned post type.
Props littler.chicken.
See #37186.

git-svn-id: https://develop.svn.wordpress.org/trunk@37952 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-04 19:33:43 +00:00
Helen Hou-Sandi
e5e8889f78 Media: Only show parent post titles when the user can read said post.
fixes #37186.


git-svn-id: https://develop.svn.wordpress.org/trunk@37941 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-01 15:06:54 +00:00
Nikolay Bachiyski
6e9a0fb948 Admin: Escape attachment name in case it contains special characters
git-svn-id: https://develop.svn.wordpress.org/trunk@37774 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-21 14:18:27 +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
Dominik Schilling (ocean90)
6a8cb09f86 Media: Change wording for media files which aren't attached.
The media library can contain files which aren't attached yet. When attaching a file you currently get "Media attachment reattached.", or the opposite "Media attachment detached.". That's redundant and can be inaccurate. It's also not easy to translate in some languages.

This change generalizes the strings to refer to a "media file" instead.

Props SergeyBiryukov, ocean90, netweb.
Fixes #36089.

git-svn-id: https://develop.svn.wordpress.org/trunk@36887 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-08 17:42:45 +00:00
Andrea Fercia
f8f12bf78a Accessibility: Remove title attributes from the Media Library list table.
Fixes #35136.

git-svn-id: https://develop.svn.wordpress.org/trunk@36331 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-17 14:45:26 +00:00
Sergey Biryukov
3068a5b333 I18N: Add missing context for 'Trash' strings.
Fixes #35054.

git-svn-id: https://develop.svn.wordpress.org/trunk@35901 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-13 19:02:30 +00:00
Scott Taylor
a69f591c55 Media: show Trash filter for Media list table when MEDIA_TRASH is true.
Props chacha102.
Fixes #34795.


git-svn-id: https://develop.svn.wordpress.org/trunk@35752 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-01 20:47:24 +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
Sergey Biryukov
e4c9f97fb3 In WP_Media_List_Table, rename $pending_count to $comment_pending_count and mark it as protected, for consistency with WP_Posts_List_Table.
See #11381.

git-svn-id: https://develop.svn.wordpress.org/trunk@35222 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-16 18:22:12 +00:00
Scott Taylor
9e267b6e72 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@34891 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 01:27:01 +00:00
Dominik Schilling (ocean90)
f79a9d4ca2 Media List Table: Remove the date display in column_parent().
It should be the time at which the post was written, but it was never because of the missing `$parent` argument.

Fixes #33238.

git-svn-id: https://develop.svn.wordpress.org/trunk@34839 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-05 22:24:41 +00:00
Scott Taylor
d416922cbf Remove some unused globals and/or their docs.
See ##33491.


git-svn-id: https://develop.svn.wordpress.org/trunk@34446 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-22 20:26:17 +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
Scott Taylor
a1805ecada Media List Table: remove the counts from the "views" portion of the toolbar, which are inconsistent with grid view. Also reduces complexity and removes potentially expensive count query.
Related to the toolbar view, remove the `wp_admin_canonical_url()` action in grid mode. Grid views that result from links from the list table view are lenses into the library and need to be indicated as such vs being a full attachment query.

Fixes #29744.


git-svn-id: https://develop.svn.wordpress.org/trunk@34256 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-17 02:29:22 +00:00
Scott Taylor
577fea566a Don't ever use the guid value when retrieving URLs for media, use wp_get_attachment_url(). Use get_attached_file() for path to file.
Fixes #33386.


git-svn-id: https://develop.svn.wordpress.org/trunk@34163 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-15 02:49:12 +00:00
Scott Taylor
ea610e66d4 In WP_Media_List_Table, fetch all pending comment counts at once, instead of for each row in the loop.
See #11381.


git-svn-id: https://develop.svn.wordpress.org/trunk@34127 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-14 19:24:59 +00:00
Scott Taylor
413df72474 Favor using the consistent and agnostic string 'Attach' over 'Attach to a post' in the media list table.
Props pavelevap.
Fixes #33515.


git-svn-id: https://develop.svn.wordpress.org/trunk@33810 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-30 03:09:25 +00:00
Scott Taylor
5cbc7a706d The 'restrict_manage_posts' hook currently fires on the Post and Media list tables, but is passed zero arguments. Pass $post_type.
Props sunnyratilal, scribu.
Fixes #17891.


git-svn-id: https://develop.svn.wordpress.org/trunk@33644 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-19 06:22:40 +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
Konstantin Obenland
32bcd95e37 Media: Don't indent action links if there is no media icon.
See #32254.



git-svn-id: https://develop.svn.wordpress.org/trunk@33269 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-14 17:45:55 +00:00
Konstantin Obenland
8ff5bc6f53 Media: Reduce link noise between icons and titles in list view.
Props afercia.
Fixes #32254.



git-svn-id: https://develop.svn.wordpress.org/trunk@33268 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-14 17:23:42 +00:00
Drew Jaynes
47502713ec Add missing summaries and @access tags to methods added to WP_Media_List_Table in 4.3.
See [32754]. See #32891.


git-svn-id: https://develop.svn.wordpress.org/trunk@33179 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-12 18:33:59 +00:00
Helen Hou-Sandi
74a2eb6790 List tables: Bring screen reader text for comments column title to media.
see #32152, [31513].


git-svn-id: https://develop.svn.wordpress.org/trunk@32991 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-28 15:43:32 +00:00
John Blackbourn
dd419b74cc Introduce a no_terms label for taxonomies. This label is used when indicating that there are no terms in the given taxonomy associated with an object.
Fixes #32150
Props afercia


git-svn-id: https://develop.svn.wordpress.org/trunk@32933 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-25 00:15:46 +00:00
Helen Hou-Sandi
0433b87fdf Media list table: Avoid PHP notices by using the proper variables.
Also visually tightens up the row actions.

props tyxla.
fixes #32657. see #29881.


git-svn-id: https://develop.svn.wordpress.org/trunk@32805 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-16 21:32:53 +00:00
Scott Taylor
296c559baf if is a statment, not a function.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32800 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-16 20:00:15 +00:00
Helen Hou-Sandi
d878ce73f5 Media list table: Restore row actions.
see #29881, #32657.


git-svn-id: https://develop.svn.wordpress.org/trunk@32798 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-16 19:46:27 +00:00
Scott Taylor
31d50764c3 In WP_Media_List_Table::display_rows():
* Move the giant `switch` statement into methods
* Call `-single_row_columns()`, which it inherits from `WP_List_Table`

See #29881.


git-svn-id: https://develop.svn.wordpress.org/trunk@32754 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-13 15:56:13 +00:00
Scott Taylor
cae366cad0 In WP_Media_List_Table::display_rows(), get_the_terms() can return WP_Error, so its return value should be checked before traversing.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32737 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-12 18:44:50 +00:00
Konstantin Obenland
995753d1d0 Improve non-visual feedback for list table items without terms.
Props karpstrucking, afercia.
Fixes #32150.



git-svn-id: https://develop.svn.wordpress.org/trunk@32725 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-11 09:27:13 +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
Helen Hou-Sandi
2da4d61f95 Media list view: ensure thumbnails are appropriately sized and constrained.
see #29993.


git-svn-id: https://develop.svn.wordpress.org/trunk@32688 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-03 15:22:14 +00:00