Commit Graph

282 Commits

Author SHA1 Message Date
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
Peter Wilson e6ccdf161f General: Further improve error messages following [42648].
Props kristastevens, melchoyce.
Fixes #38332 for trunk.


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


git-svn-id: http://core.svn.wordpress.org/trunk@42547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-02-19 02:13:32 +00:00
Peter Wilson 0d39b35c11 General: Replace `Cheatin’ uh?` with friendlier error messages.
While intended as a playful error message, `Cheatin’ uh?` can be interpreted as insulting or accusatory in an already stressful situation. This replaces Cheatin’ with more meaningful error messages, depending on the error that occurs.

Props ElectricFeet, EricMeyer, karmatosed, dd32, BandonRandon, melchoyce for language; dmsnell for original patch; peterwilsoncc.
Fixes #38332.


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


git-svn-id: http://core.svn.wordpress.org/trunk@42477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-02-05 02:30:34 +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
Gary Pendergast c90cfa3b50 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@42057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-26 23:57:55 +00:00
Sergey Biryukov 1929ba612e Taxonomy: Allow for adding custom list table views to taxonomy screens.
Props eventualo, mariovalney, riddhiehta02, llemurya.
Fixes #30829.
Built from https://develop.svn.wordpress.org/trunk@41378


git-svn-id: http://core.svn.wordpress.org/trunk@41211 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-13 15:20:44 +00:00
John Blackbourn 4981452aba General: Fix more instances of inconsistent parameters passed to various filters, plus fix some filter docs.
See #38462, #41017

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


git-svn-id: http://core.svn.wordpress.org/trunk@41061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-03 16:13:44 +00:00
Adam Silverstein d1ec180619 Taxonomy: Add a "delete" button on term edit page.
Add a 'delete' link next to the update button on the term edit screen so you can delete a term while you are reviewing it's details. 

Props cklosows, bradt, ocean90, johnbillion, DrewAPicture, ryan, MatheusGimenez, maguiar.
Fixes #9777.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 19:26:41 +00:00
Boone Gorges b6572af5d2 Taxonomy: Improve 'Parent' label when editing taxonomy terms.
Instead of the hardcoded 'Parent', use the `parent_item` label.

Props abrain, dlh.
Fixes #34545.
Built from https://develop.svn.wordpress.org/trunk@40146


git-svn-id: http://core.svn.wordpress.org/trunk@40085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-03 02:54:42 +00:00
Sergey Biryukov 8603da629f Taxonomy: Add an explanation for "Parent" dropdown for hierarchical custom taxonomies.
Props F J Kaiser, raggedrobins, DrewAPicture, diddledan, SergeyBiryukov.
Fixes #23447.
Built from https://develop.svn.wordpress.org/trunk@39895


git-svn-id: http://core.svn.wordpress.org/trunk@39832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-13 04:19:39 +00:00
Peter Wilson 25e462dbe7 Taxonomy: Redirect to current taxonomy when adding a term without AJAX.
Fixes a regression in which adding terms via a full page refresh, ie without AJAX, would always redirect to the tags taxonomy.

Props szaqal21.
Fixes #39328 for trunk.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-30 03:11:42 +00:00
Andrea Fercia 10819d629f Accessibility: Remove inappropriate content from the Edit Categories and Edit Tags screens headings.
See #26601.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-09 20:50:41 +00:00
Sergey Biryukov b1ed607578 Text Changes: Merge and clarify some permission error strings in the admin.
See #38857.
Built from https://develop.svn.wordpress.org/trunk@39308


git-svn-id: http://core.svn.wordpress.org/trunk@39248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-19 01:38:31 +00:00
John Blackbourn bc5c87710e Administration: Standardise the docblocks for the `handle_bulk_actions-*` filters.
Props ericlewis, Veraxus
Fixes #16031

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


git-svn-id: http://core.svn.wordpress.org/trunk@38901 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 14:45:29 +00:00
Dominik Schilling 32516036db Taxonomy: Remove `paged` argument from referer and add it only if current page is greater than 1.
Props swissspidy.
See #38194.
Built from https://develop.svn.wordpress.org/trunk@38752


git-svn-id: http://core.svn.wordpress.org/trunk@38695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-07 20:06:28 +00:00
Dominik Schilling 0dcd49e6fc Taxonomy: Don't drop term order and current page when bulk deleting terms.
* Removes special handling for `edit-tags.php` which is no longer required because of `term.php`. Related: [34202] and [36308].
* Sets `$referer` to `$_SERVER['REQUEST_URI']` because `wp_get_referer()` returns false if `$_SERVER['REQUEST_URI'] === $_REQUEST['_wp_http_referer']`.
* Sets `paged` always to `$pagenum` which is the value of `$wp_list_table->get_pagenum();`. This avoids an additional redirect when you delete an item which was previously on the last page.

Fixes #38194.
Built from https://develop.svn.wordpress.org/trunk@38750


git-svn-id: http://core.svn.wordpress.org/trunk@38693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-07 19:39:29 +00:00
Helen Hou-Sandí 10323e5e22 Taxonomy: Remove the popular tag cloud from `edit-tags.php`.
Sorting by count (which wasn't possible at the time the tag cloud was introduced) is more effective, though we should likely make count sort by `DESC` initially rather than `ASC`.

props ramiy.
fixes #36964.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-05 21:26:31 +00:00
Andrea Fercia 86ad7855be Accessibility: Remove target=_blank from the help tab links on several admin screens.
Stop taking control of users' browsers.

Props rianrietveld.
Fixes #38145. See #23432.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-04 20:27:33 +00:00
John Blackbourn b84023ea33 Taxonomy: Introduce more fine grained capabilities for managing taxonomy terms.
This introduces the singular `edit_term`, `delete_term`, and `assign_term` meta capabilities for terms, and switches the base capability name for tags from `manage_categories` to `manage_post_tags` and the corresponding `edit_post_tags`, `delete_post_tags`, and `assign_post_tags`.

All of these capabilities ultimately map to `manage_categories` so by default there is no change in the behaviour of the capabilities for categories, tags, or custom taxonomies. The `map_meta_cap` filter and the `capabilities` argument when registering a taxonomy now allow for control over editing, deleting, and assigning individual terms, as well as a separation of capabilities for tags from those of categories.

Fixes #35614
Props johnjamesjacoby for feedback

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


git-svn-id: http://core.svn.wordpress.org/trunk@38641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 22:40: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
Sergey Biryukov 3c5204f9f4 Docs: Correct the description of `{$taxonomy}_term_new_form_tag` hook, making it more consistent with other `*_form_tag` hooks.
Props BjornW.
Fixes #38104.
Built from https://develop.svn.wordpress.org/trunk@38629


git-svn-id: http://core.svn.wordpress.org/trunk@38572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-20 13:33:29 +00:00
Sergey Biryukov 7d421dbe42 Text Changes: Add a full stop to "Invalid taxonomy" and "Invalid term ID" strings, for consistency with similar post-related messages.
See #18218, #32329.
Built from https://develop.svn.wordpress.org/trunk@38077


git-svn-id: http://core.svn.wordpress.org/trunk@38018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-17 16:15:34 +00:00
Dominik Schilling 25e66e4f1e Text Changes: Unify permission error messages.
The new format looks like "Sorry, you are not allowed to <action>.". This provides a consistent experience for all error messages related to missing permissions. It also reduces the number of similar strings and allows translators to provide a consistent style in their language.

Props ramiy, Presskopp.
Fixes #34521.
Built from https://develop.svn.wordpress.org/trunk@37914


git-svn-id: http://core.svn.wordpress.org/trunk@37855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-29 15:16:29 +00:00
Sergey Biryukov d4e1683d23 Taxonomy: Introduce a `redirect_term_location` filter to change the redirect on term editing.
This complements the `redirect_post_location` filter added in [12260].

Props alexvandervegt.
Fixes #36367.
Built from https://develop.svn.wordpress.org/trunk@37696


git-svn-id: http://core.svn.wordpress.org/trunk@37662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-14 15:06:30 +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
Andrea Fercia 1ae8891261 Accessibility: make the tab order match the visual order in the Edit terms screens.
Fixes #35664.
Built from https://develop.svn.wordpress.org/trunk@37439


git-svn-id: http://core.svn.wordpress.org/trunk@37405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-16 13:02:29 +00:00
Pascal Birchler 27fa2f65eb Taxonomy: Introduce `wp-admin/term.php` for editing single terms.
This is similar to `edit.php` -> `post.php` and `users.php` -> `user-edit.php` and fixes a bug where screen options for the list table were shown while editing a term.

Fixes #34988.
Built from https://develop.svn.wordpress.org/trunk@36308


git-svn-id: http://core.svn.wordpress.org/trunk@36275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-15 08:27:27 +00:00
Pascal Birchler aaa11d6207 Allow searching for `0` throughout the admin.
Fixes #31025.
Built from https://develop.svn.wordpress.org/trunk@36302


git-svn-id: http://core.svn.wordpress.org/trunk@36269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-14 20:06:25 +00:00
Andrea Fercia 24afea92c2 When editing terms, properly display an admin `notice-warning` when `tag_ID` is empty.
Also, avoids two related PHP notices when empty or not set (and thus the global `$tag` is a WP_Error object).

Fixes: #34515.
Built from https://develop.svn.wordpress.org/trunk@35875


git-svn-id: http://core.svn.wordpress.org/trunk@35839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-11 22:49:41 +00:00
Sergey Biryukov db2189e717 After [34891], rename new post type and taxonomy label keys to match the default strings.
See #32147.
Built from https://develop.svn.wordpress.org/trunk@35376


git-svn-id: http://core.svn.wordpress.org/trunk@35340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-23 16:48:25 +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
John Blackbourn 970752a351 Remove the ability to view the term editing screen for taxonomies with `show_ui` set to `false`. It is unexpected and unintended behaviour that this is allowed.
If your plugin or site does rely on this behaviour, the arguments that are passed to `register_taxonomy()` should be altered so that `show_ui` is `true`, and arguments such as `show_in_menu` and `show_in_nav_menus` are false.

Fixes #33938

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


git-svn-id: http://core.svn.wordpress.org/trunk@34323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-20 17:11:25 +00:00
Sergey Biryukov a87885262f Include placeholder in translator comment.
See #31863.
Built from https://develop.svn.wordpress.org/trunk@34306


git-svn-id: http://core.svn.wordpress.org/trunk@34270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-18 19:03:25 +00:00
Scott Taylor ea0cf44097 Don't use HTML tags in translation strings in `edit-tags.php`.
Props ramiy.
Fixes #31863.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34267 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-18 18:53:25 +00:00
Scott Taylor ff3ae0e747 Don't redirect to the Term list table after submitting the form on the Edit Term page.
Props chiragswadia, UmeshSingla, rhyswynne, afercia.
Fixes #17455.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34166 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 15:59:42 +00:00
Scott Taylor 9957d43e13 Bump H3 headings to H2 on the {Term} screens for better accessibility.
Props mrahmadawais.
Fixes #33658.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33886 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-05 20:17:25 +00:00
Sergey Biryukov c3b663ad8d Provide more helful feedback than just “Cheatin’ uh?” for permission errors in `wp-admin/edit-tags.php`.
props ericlewis, kraftbj, lukecarbis, mrmist.
fixes #33670. see #14530.
Built from https://develop.svn.wordpress.org/trunk@33852


git-svn-id: http://core.svn.wordpress.org/trunk@33820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-02 16:06:21 +00:00
Scott Taylor c15a1c2bab Replace some hyphens with `&mdash;`s in admin help tabs.
Props pixolin.
Fixes #30605.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33608 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-19 04:53:25 +00:00
Konstantin Obenland 7dc1d06e64 Proper heading for admin screens.
First step towards restoring a good heading structure in wp-admin.
The previous `<h1>` contained the site title and a link to the front page and was removed with the toolbar refactoring in 3.2.

Props joedolson, afercia.
Fixes #31650.


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


git-svn-id: http://core.svn.wordpress.org/trunk@32945 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-27 15:41:25 +00:00
Boone Gorges 66c1d75c1c Tag/category conversion link on edit-tags.php should point to specific importer page when cat2tag plugin is active.
Props solarissmoke, c3mdigital.
Fixes #16369.
Built from https://develop.svn.wordpress.org/trunk@32792


git-svn-id: http://core.svn.wordpress.org/trunk@32763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-16 04:30:26 +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
Dominik Schilling 64fc7294b6 Use HTTPS URLs for codex.wordpress.org.
see #27115.
Built from https://develop.svn.wordpress.org/trunk@32116


git-svn-id: http://core.svn.wordpress.org/trunk@32095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-12 21:29:32 +00:00
Drew Jaynes d8f67f4340 Fix Docblock syntax for the `taxonomy_parent_dropdown_args` filter.
See [30998]. See #31888

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


git-svn-id: http://core.svn.wordpress.org/trunk@31982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-04 14:13:27 +00:00
Helen Hou-Sandí d85f8fe326 Admin notices: Make (most) core notices dismissible.
These no longer return upon refreshing the page when JS is on and working, so users should be able to dismiss them. This is particularly important on the post edit screen when DFW is triggered, but pretty much all notices can be dismissed if needed. A post on Make/Core will follow with information on how this can be leveraged in plugins.

props valendesigns, afercia, paulwilde, adamsilverstein, helen.
fixes #31233. see #23367.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-01 22:06:28 +00:00
Dominik Schilling 11a205d489 Edit Terms: Show error messages actually as error messages.
props rahulbhangale, SergeyBiryukov.
fixes #31241.
Built from https://develop.svn.wordpress.org/trunk@31823


git-svn-id: http://core.svn.wordpress.org/trunk@31805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-18 21:59:27 +00:00
Dominik Schilling 13ad2d4e16 Screen Options: Improve items per page option label.
Previously the label just said "Posts", "Pages", or "Comments". This was bad in terms of accessibility and internationalization because of missing context.
This change adds a default label "Number of items per page:" to `WP_Screen->render_per_page_options()` and removes all the existing one-word labels.

props afercia.
fixes #31349, #15576.
Built from https://develop.svn.wordpress.org/trunk@31696


git-svn-id: http://core.svn.wordpress.org/trunk@31677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-10 15:32:27 +00:00
Sergey Biryukov 067ee8c476 Remove inaccurate part of {$taxonomy}_add_form_fields action description.
props joostdekeijzer.
fixes #31052.
Built from https://develop.svn.wordpress.org/trunk@31247


git-svn-id: http://core.svn.wordpress.org/trunk@31228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-19 15:31:23 +00:00
Scott Taylor 7f8b548df1 In HTML5, the `action` attribute is no longer required. Remove this attribute when empty.
The admin HTML is served with the HTML5 doctype.

"The action and formaction content attributes, if specified, must have a value that is a valid non-empty URL potentially surrounded by spaces." 
http://www.w3.org/html/wg/drafts/html/master/forms.html#attr-fs-action

Props voldemortensen.
Fixes #30126.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 04:16:24 +00:00
Scott Taylor 84867b3e9c Admin globals:
* Declare `$wp_importers` as a global in `admin.php`
* Declare `$post_type`, `$post_type_object`, and  `$post` as globals where applicable

See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-10 05:29:22 +00:00
Scott Taylor 60b0cd7943 The keyword `elseif` should be used instead of `else if` so that all control keywords look like single words.
This was a mess, is now standardized across the codebase, except for a few 3rd-party libs. 

See #30799.

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


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