Commit Graph

140 Commits

Author SHA1 Message Date
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
Gary Pendergast
574821573a General: Fix some precision alignment formatting warnings.
The WPCS `WordPress.WhiteSpace.PrecisionAlignment` rule throws warnings for a bunch of code that will likely cause issues for `wpcbf`. Fixing these manually beforehand gives us better auto-fixed results later.

See #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42228 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-26 23:56:25 +00:00
Sergey Biryukov
eb4f4bc87e Administration: Add .protected-post-excerpt class to password-protected post excerpts in the posts list.
Props Soean, mp518, slaFFik, SergeyBiryukov.
Fixes #41426.

git-svn-id: https://develop.svn.wordpress.org/trunk@41770 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-05 02:49:15 +00:00
Andrea Fercia
e2c4ae805f Quick/Bulk Edit: Improve the inline error messages styling.
- uses the core `notice` styles for the Quick Edit form inline error messages
- adds missing periods at the end of a few error messages

Props ocean90, karmatosed, melchoyce, afercia.
Fixes #35496.


git-svn-id: https://develop.svn.wordpress.org/trunk@41684 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 21:51:09 +00:00
Andrea Fercia
02588452f7 Accessibility: List Tables: use aria-current for the views current link.
The `aria-current` attribute is a simple, effective way to help assistive
technologies users orientate themselves within a list of items. Continues the 
introduction in core of the `aria-current` attribute after [41359] and [41371].

Props joedolson, flixos90, afercia.
Fixes #32399.


git-svn-id: https://develop.svn.wordpress.org/trunk@41683 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 19:43:02 +00:00
Sergey Biryukov
bc23b8840d Quick/Bulk Edit: Remove duplicate inline-edit-{$screen->post_type} CSS class from Quick Edit table rows.
Props ibachal.
Fixes #41906.

git-svn-id: https://develop.svn.wordpress.org/trunk@41576 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-23 11:01:45 +00:00
John Blackbourn
3aadc71579 General: Fix various instances of incorrect filter docs and incorrect filter and action parameters.
Props keesiemeijer for identifying the issues

See #38462


git-svn-id: https://develop.svn.wordpress.org/trunk@41219 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 15:42:45 +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
Sergey Biryukov
3048eb8bd3 Docs: Add missing closing quote for 'Restore' in post_row_actions and page_row_actions filters documentation.
See #26397.

git-svn-id: https://develop.svn.wordpress.org/trunk@40882 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-07 23:10:15 +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
d766856878 Posts, Post Types: Introduce post_date_column_status filter for post status text in list tables' Date column.
Props pbearne.
Fixes #39545.

git-svn-id: https://develop.svn.wordpress.org/trunk@40361 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-01 14:07:01 +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
John Blackbourn
a96089e8e6 Posts, Post Types: When using Excerpt mode on the Posts list table, ensure the excerpt output matches what was manually entered into the Excerpt field.
git-svn-id: https://develop.svn.wordpress.org/trunk@39956 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-26 13:40:17 +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
Felix Arntz
6e02c370bf Multisite: Remove redundant is_super_admin() when checking for edit_others_posts.
The super admin on multisite as well as the administrator on non-multisite both have this capability already. For custom post types using different capabilities this change ensures that only users with that capability have permissions.

Fixes #39059. See #37616.


git-svn-id: https://develop.svn.wordpress.org/trunk@39539 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-07 22:08:52 +00:00
Dion Hulse
7e9960edad Posts, Post Types: Fix Quick Edit to correctly set the page template for non-hierarchical post types.
Props dd32, swissspidy.
Fixes #38655.


git-svn-id: https://develop.svn.wordpress.org/trunk@39210 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-13 07:41:30 +00:00
Andrea Fercia
29e75c5d77 Administration: Better accessibility for the "Post locked" indicator.
- hides the locked icon from assistive technologies
- adds hidden text to indicate the post is locked
- moves the info about who's currently editing to the top of the title table cell

Props mariovalney.
Fixes #38185.


git-svn-id: https://develop.svn.wordpress.org/trunk@38965 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 17:58:34 +00:00
Pascal Birchler
a9516abb54 Posts, Post Types: Add support for post type templates.
WordPress has supported custom page templates for over 12 years, allowing developers to create various layouts for specific pages.
While this feature is very helpful, it has always been limited to the 'page' post type and not was not available to other post types.

By opening up the page template functionality to all post types, we continue to improve the template hierarchy's flexibility.

In addition to the `Template Name` file header, the post types supported by a template can be specified using `Template Post Type: post, foo, bar`.
When at least one template exists for a post type, the 'Post Attributes' meta box will be displayed in the back end, without the need to add post type support for `'page-attributes'`. 'Post Attributes' can be customized per post type using the `'attributes'` label when registering a post type.

Props johnbillion, Mte90, dipesh.kakadiya, swissspidy.
Fixes #18375.

git-svn-id: https://develop.svn.wordpress.org/trunk@38951 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 08:06:43 +00:00
Pascal Birchler
f508d80a1b List Tables: Do not show filter button when there are no filter options available.
Props juhise, dipesh.kakadiya, swissspidy.
Fixes #37407.

git-svn-id: https://develop.svn.wordpress.org/trunk@38854 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-21 10:32:55 +00:00
Andrew Ozz
a1cae16efe Accessible Tags autocomplete:
- Replace suggest.js with UI Autocomplete.
- Use the same settings like in the editor link toolbar.
- Abstract it and add in a new file, tags-suggest.js. Then make it a dependency for the Tags postbox(es) and Quick and Bulk Edit.
- Add `data-wp-taxonomy` on all input elements to improve handling in the UI for custom taxonomies.

Props afercia, azaozz.
See #33902.

git-svn-id: https://develop.svn.wordpress.org/trunk@38797 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-14 22:39:49 +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
Drew Jaynes
ea78fbdcdb Docs: Fix minor formatting and syntax for wp-admin/* elements introduced in 4.6.
See #37318.


git-svn-id: https://develop.svn.wordpress.org/trunk@38024 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-09 13:59:16 +00:00
Dominik Schilling (ocean90)
bded47a1b6 Posts: Introduce WP_Post_Type and use it in register_post_type() and unregister_post_type().
This changes the global `$wp_post_types` to an array of `WP_Post_Type` objects. `WP_Post_Type` includes methods to handle post type supports, rewrite rules, meta boxes, hooks, and taxonomies.
Each post type argument becomes a property of `WP_Post_Type`.

Props swissspidy, flixos90.
Fixes #36217.

git-svn-id: https://develop.svn.wordpress.org/trunk@37890 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 16:40:33 +00:00
Pascal Birchler
70693b520f Posts list table: Add a filter to disable the categories dropdown.
This allows one to short-circuit its output before any queries are run, similar to how it was done for the months dropdown in [31438].

Props davidmosterd for initial patch.
Fixes #36152.

git-svn-id: https://develop.svn.wordpress.org/trunk@37856 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-23 15:36:33 +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)
ab3afd670d List Tables: Pass the $which parameter to restrict_manage_posts and restrict_manage_users.
`$which` contains the location of the extra table nav markup: 'top' or 'bottom'.

Props martin.krcho.
Fixes #35307.

git-svn-id: https://develop.svn.wordpress.org/trunk@37422 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-12 15:12:11 +00:00
Jeremy Felt
91513893c2 Posts: Call set_url_scheme() consistently on URLs passed through preview_post_link
After [34170], some preview URLs that passed through `set_url_scheme()` no longer do so. We can restore that behavior by applying `set_url_scheme()` whenever `get_preview_post_link()` provides the URL.

Props danielbachhuber.
Fixes #35407.


git-svn-id: https://develop.svn.wordpress.org/trunk@36926 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-10 04:41:34 +00:00
Sergey Biryukov
1b91fc660f 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@36808 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-02 22:13:14 +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
Andrea Fercia
cde933e306 After [36171] remove all the occurrences of the old CSS clearfix.
The old clearfix was applied to very specific items and defined multiple times
across CSS files. Uses the new generic `.wp-clearfix` utility class instead.

See #26396.

git-svn-id: https://develop.svn.wordpress.org/trunk@36422 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-30 13:45:37 +00:00
Andrea Fercia
2e78169eee After [36333] correctly use esc_attr() instead of esc_attr__().
See #35313.

git-svn-id: https://develop.svn.wordpress.org/trunk@36334 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-17 16:02:24 +00:00
Andrea Fercia
838f953d4d Accessibility: Remove title attributes from the Posts list table.
Fixes #35313.

git-svn-id: https://develop.svn.wordpress.org/trunk@36333 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-17 15:46:01 +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
Boone Gorges
ded2547b57 Show user_login in Dashboard user dropdowns.
User dropdowns in wp-admin have traditionally shown the users' display names.
However, this causes ambiguity when users share display names. To correct this,
we now show the unique user_login in parentheses after the display name.

The new `display_name_with_login` value for the `show` parameter of
`wp_dropdown_users()` enables this functionality. The default value of `show`
has not been changed, for backward compatibility, but all instances of
`wp_dropdown_users()` in core wp-admin have been switched.

This changeset also reduces some duplicated logic when assembling a user list
when `include_selected` is true.

Props krogsgard, boonebgorges.
Fixes #31251.

git-svn-id: https://develop.svn.wordpress.org/trunk@35790 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-06 20:56:11 +00:00
Scott Taylor
0749514c94 List Tables: After [35622] and [34271], improve pagination logic when queries are altered.
Props bradyvercher.
Fixes #29870.


git-svn-id: https://develop.svn.wordpress.org/trunk@35683 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-18 20:24:44 +00:00
Scott Taylor
d2d6241aa5 List Tables: After [34728], don't try to infer orderby from query params.
List tables are really good.

Props cklosows.
Fixes #25493.


git-svn-id: https://develop.svn.wordpress.org/trunk@35682 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-18 20:18:08 +00:00
Scott Taylor
b1d93d6d6a List Tables: after [34271], account for searches when calculating pagination.
Fixes #29870.



git-svn-id: https://develop.svn.wordpress.org/trunk@35622 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-11 23:13:46 +00:00
Dominik Schilling (ocean90)
5ee5029109 List Tables: Define the global $mode variable for Quick Edit savings.
Also remove two unused global imports for `$mode`.

Fixes #34577.

git-svn-id: https://develop.svn.wordpress.org/trunk@35518 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-04 21:28:55 +00:00
Helen Hou-Sandi
7adf6e9125 List tables: Move the view mode switcher into screen options for posts.
Having a view mode switcher nestled within table navigation makes no sense, especially now that it's a sticky user option. While less convenient for frequent switching, there is no evidence as of yet that there is a large userbase of frequent view mode switchers.

Introduces a filter for `view_mode_post_types`, which by default is all hierarchical post types with edit UI on.

props Oxymoron.
fixes #22222.


git-svn-id: https://develop.svn.wordpress.org/trunk@35357 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-22 19:24:10 +00:00
Drew Jaynes
84d3e1f305 Administration: Introduce the manage_posts_extra_tablenav action, which fires inside the tablenav for the posts list table, and just outside the "actions" container.
Props hlashbrooke, wonderboymusic.
Fixes #30341.


git-svn-id: https://develop.svn.wordpress.org/trunk@35263 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-18 14:55:52 +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
5c19a7a704 Replace Quick Edit and Bulk Edit headings with <legend> elements.
Props afercia.
Fixes #34289.

git-svn-id: https://develop.svn.wordpress.org/trunk@35234 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-17 00:44:12 +00:00
Sergey Biryukov
0d4a7ee029 In WP_Posts_List_Table, correct the type for $comment_pending_count.
See #11381.

git-svn-id: https://develop.svn.wordpress.org/trunk@35223 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-16 18:24:25 +00:00
Scott Taylor
6507668f4e Posts List Table: ensure that "All" gets the "current" CSS class when applicable.
Props afercia.
Fixes #19609.


git-svn-id: https://develop.svn.wordpress.org/trunk@34889 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 00:08:42 +00:00
John Blackbourn
d8c9450179 Correct pagination when viewing the 'Mine' link on the post listing screen.
Fixes #19609
Props ocean90


git-svn-id: https://develop.svn.wordpress.org/trunk@34837 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-05 21:35:18 +00:00
Scott Taylor
63b6bc751d Post List Table: Ensure that edit.php with no query string produces the proper markup and links in the date column header.
Add 2 methods to `WP_List_Table`, `->get_orderby()` and `->get_order()`. Override the methods in `WP_Posts_List_Table`.

`WP_Posts_List_Table` calls `wp_edit_posts_query()` in `->prepare_items()` which is a wrapper for `wp()`. As such, we can obtain `orderby` and `order` via `get_query_var()`, instead of the URL.

Fixes #25493.



git-svn-id: https://develop.svn.wordpress.org/trunk@34728 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 02:09:41 +00:00
John Blackbourn
9271360932 Correct the logic used when determining whether to display the 'Mine' link on post list tables. It should only be shown when the count for the user's posts differs for the total count of posts. is_multi_author() cannot be used because it only considers Posts.
Fixes #19609


git-svn-id: https://develop.svn.wordpress.org/trunk@34667 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-28 19:14:56 +00:00
Scott Taylor
1d6c744604 Posts List Table: check is_multi_author() before attempting to set ->user_posts_count. Also, don't show "Mine" when the count is the same as "All."
Fixes #19609.


git-svn-id: https://develop.svn.wordpress.org/trunk@34584 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-26 06:50:03 +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