Commit Graph

89 Commits

Author SHA1 Message Date
Sergey Biryukov e72fff9cef Code Modernization: Replace `dirname( __FILE__ )` calls with `__DIR__` magic constant.
This avoids the performance overhead of the function call every time `dirname( __FILE__ )` was used instead of `__DIR__`.

This commit also includes:

* Removing unnecessary parentheses from `include`/`require` statements. These are language constructs, not function calls.
* Replacing `include` statements for several files with `require_once`, for consistency:
 * `wp-admin/admin-header.php`
 * `wp-admin/admin-footer.php`
 * `wp-includes/version.php`

Props ayeshrajans, desrosj, valentinbora, jrf, joostdevalk, netweb.
Fixes #48082.

git-svn-id: https://develop.svn.wordpress.org/trunk@47198 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-06 06:31:22 +00:00
Sergey Biryukov cfc3b57488 Docs: Improve inline comments per the documentation standards.
Includes minor code layout fixes for better readability.

See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47122 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-29 00:43:23 +00:00
Sergey Biryukov 3b25bc4362 Coding Standards: Use strict comparison in `wp-admin/edit-tags.php`.
Props passoniate.
Fixes #48985.

git-svn-id: https://develop.svn.wordpress.org/trunk@46962 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-15 10:44:37 +00:00
John Blackbourn 726d3a1d9c Docs: Increase the specificity of various docblock parameter types and return types.
See #48303

git-svn-id: https://develop.svn.wordpress.org/trunk@46823 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-06 22:41:26 +00:00
Sergey Biryukov 972ca00d2d Docs: Move the canonical DocBlock for `handle_bulk_actions-{$screen}` action to `wp-admin/edit.php`.
* Document accepted values for the `$items` parameter.
* Use interpolated syntax for the filter name.

Props dilipbheda, johnbillion, SergeyBiryukov.
Fixes #48857.

git-svn-id: https://develop.svn.wordpress.org/trunk@46811 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-03 13:56:25 +00:00
Sergey Biryukov 26dec96b21 Docs: Use the `{@see ...}` tag for the replacement in `@deprecated` tags, so that Developer Reference could automatically link to the replacement.
Props jrf.
See #48255.

git-svn-id: https://develop.svn.wordpress.org/trunk@46685 602fd350-edb4-49c9-b593-d223f7449a82
2019-11-09 13:03:02 +00:00
Sergey Biryukov ae2ebb8b18 Coding Standards: Consistently use `do_action_deprecated()` and `apply_filters_deprecated()` for deprecated hooks.
Props jrf.
See #48255.

git-svn-id: https://develop.svn.wordpress.org/trunk@46684 602fd350-edb4-49c9-b593-d223f7449a82
2019-11-09 12:57:27 +00:00
Sergey Biryukov 00b03f2a6f I18N: Capitalize translator comments consistently, add trailing punctuation.
Includes minor code layout fixes.

See #44360.

git-svn-id: https://develop.svn.wordpress.org/trunk@45932 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-03 00:39:13 +00:00
Sergey Biryukov a7513ac8e0 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@45926 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-01 17:12:43 +00:00
Sergey Biryukov 5618dfc6d3 Accessibility: Taxonomy: When a new category or tag is being added, show a spinner and noop the button to avoid multiple requests.
Props andg, afercia, guddu1315, SergeyBiryukov.
Fixes #47607.

git-svn-id: https://develop.svn.wordpress.org/trunk@45683 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-26 17:45:21 +00:00
Sergey Biryukov ae8a620efb General: First pass at replacing Codex URLs with a corresponding HelpHub or DevHub article.
Props ianbelanger, tobifjellner, SergeyBiryukov.
See #47771.

git-svn-id: https://develop.svn.wordpress.org/trunk@45674 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-25 22:44:48 +00:00
Gary Pendergast 6b61c34ded Coding Standards: Mark the handful of hook names with uppercase characters or hyphens as ignored.
See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45599 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-05 01:44:41 +00:00
Gary Pendergast 8efcc32fde Help: Update support forum links.
There are a lot of places in Core that link to https://wordpress.org/support/ for the support forums, but that's now the URL for HelpHub. The new forums link is https://wordpress.org/support/forums/.

Props jitendrabanjara1991, dilipbheda, mukesh27, ianbelanger.
Fixes #46790.



git-svn-id: https://develop.svn.wordpress.org/trunk@45140 602fd350-edb4-49c9-b593-d223f7449a82
2019-04-08 22:58:49 +00:00
Pascal Birchler 1264df85b3 Build/Test Tools: Fix coding standards issues after [44515] and [44514].
See #44494, #43743.


git-svn-id: https://develop.svn.wordpress.org/trunk@44516 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-09 12:36:43 +00:00
Pascal Birchler aa3be4873e Taxonomy: Display term list table in full width if there is no edit form.
Makes sure there is no empty space when a user can manage terms but lacks the capability to edit terms.

Props mathieuhays, marcwieland95.
Fixes #43743.


git-svn-id: https://develop.svn.wordpress.org/trunk@44515 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-09 12:04:32 +00:00
Gary Pendergast 456e243224 Taxonomies: Improve description of default category behaviour.
Add some extra information to the Categories list screen, explaining why the default category doesn't have a Delete button.

Props Codestor.
Fixes #44961.



git-svn-id: https://develop.svn.wordpress.org/trunk@43666 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-02 19:18:58 +00:00
Gary Pendergast 75c7cb5acf Taxonomy: Remove the "Note" label from the notes on the Category edit list.
There are notes on both the Tag and Category pages, but only the latter prefixes it with a "Note" label.

Props joanrho, pratikthink, jainnidhi.
Fixes #43800.



git-svn-id: https://develop.svn.wordpress.org/trunk@43663 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-01 21:55:33 +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
Peter Wilson d002fde80e General: Further improve error messages following [42648].
Props kristastevens, melchoyce.
Fixes #38332 for trunk.



git-svn-id: https://develop.svn.wordpress.org/trunk@42719 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-19 02:12:41 +00:00
Peter Wilson f317869c7f 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@42648 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-05 02:29:53 +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
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 9bdad8906a Taxonomy: Allow for adding custom list table views to taxonomy screens.
Props eventualo, mariovalney, riddhiehta02, llemurya.
Fixes #30829.

git-svn-id: https://develop.svn.wordpress.org/trunk@41378 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-13 15:19:02 +00:00
John Blackbourn 17fe24286d General: Fix more instances of inconsistent parameters passed to various filters, plus fix some filter docs.
See #38462, #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@41221 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 16:12:25 +00:00
Adam Silverstein c21b828581 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@40655 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-12 19:25:43 +00:00
Boone Gorges 5983e88ab1 Taxonomy: Improve 'Parent' label when editing taxonomy terms.
Instead of the hardcoded 'Parent', use the `parent_item` label.

Props abrain, dlh.
Fixes #34545.

git-svn-id: https://develop.svn.wordpress.org/trunk@40146 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-03 02:53:34 +00:00
Sergey Biryukov ce89e8dd48 Taxonomy: Add an explanation for "Parent" dropdown for hierarchical custom taxonomies.
Props F J Kaiser, raggedrobins, DrewAPicture, diddledan, SergeyBiryukov.
Fixes #23447.

git-svn-id: https://develop.svn.wordpress.org/trunk@39895 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-13 04:18:16 +00:00
Peter Wilson f6fa5ddda7 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@39649 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-30 03:10:34 +00:00
Andrea Fercia 7b7914a99f Accessibility: Remove inappropriate content from the Edit Categories and Edit Tags screens headings.
See #26601.


git-svn-id: https://develop.svn.wordpress.org/trunk@39553 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-09 20:49:49 +00:00
Sergey Biryukov 81353e76be Text Changes: Merge and clarify some permission error strings in the admin.
See #38857.

git-svn-id: https://develop.svn.wordpress.org/trunk@39308 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 01:37:25 +00:00
John Blackbourn 573912fcfd Administration: Standardise the docblocks for the `handle_bulk_actions-*` filters.
Props ericlewis, Veraxus
Fixes #16031


git-svn-id: https://develop.svn.wordpress.org/trunk@38958 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 14:44:57 +00:00
Dominik Schilling (ocean90) cf14d8a2a2 Taxonomy: Remove `paged` argument from referer and add it only if current page is greater than 1.
Props swissspidy.
See #38194.

git-svn-id: https://develop.svn.wordpress.org/trunk@38752 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-07 20:05:45 +00:00
Dominik Schilling (ocean90) 981ff63724 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38750 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-07 19:38:03 +00:00
Helen Hou-Sandi a0686cacd1 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38735 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-05 21:25:50 +00:00
Andrea Fercia 5ba47b2119 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38725 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-04 20:26:09 +00:00
John Blackbourn 17ef6d8cfa 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


git-svn-id: https://develop.svn.wordpress.org/trunk@38698 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 22:39:32 +00:00
Eric Andrew Lewis c75fb5e9ca 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@38647 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-23 20:32:48 +00:00
Sergey Biryukov d9e0272707 Docs: Correct the description of `{$taxonomy}_term_new_form_tag` hook, making it more consistent with other `*_form_tag` hooks.
Props BjornW.
Fixes #38104.

git-svn-id: https://develop.svn.wordpress.org/trunk@38629 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-20 13:32:33 +00:00
Sergey Biryukov 776b3c3f1d Text Changes: Add a full stop to "Invalid taxonomy" and "Invalid term ID" strings, for consistency with similar post-related messages.
See #18218, #32329.

git-svn-id: https://develop.svn.wordpress.org/trunk@38077 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-17 16:14:27 +00:00
Dominik Schilling (ocean90) 206380180e 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@37914 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-29 15:15:40 +00:00
Sergey Biryukov 1a8ca6a167 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@37696 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 15:05:21 +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
Andrea Fercia a595b2ff53 Accessibility: make the tab order match the visual order in the Edit terms screens.
Fixes #35664.

git-svn-id: https://develop.svn.wordpress.org/trunk@37439 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-16 13:02:00 +00:00
Pascal Birchler 2241519865 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@36308 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 08:26:06 +00:00
Pascal Birchler cc6fe1179d Allow searching for `0` throughout the admin.
Fixes #31025.

git-svn-id: https://develop.svn.wordpress.org/trunk@36302 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-14 20:05:06 +00:00
Andrea Fercia 4dfb95179a 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@35875 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-11 22:48:49 +00:00
Sergey Biryukov c7cc7c44fe After [34891], rename new post type and taxonomy label keys to match the default strings.
See #32147.

git-svn-id: https://develop.svn.wordpress.org/trunk@35376 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-23 16:47:57 +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
John Blackbourn ce126c10c0 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


git-svn-id: https://develop.svn.wordpress.org/trunk@34359 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-20 17:10:55 +00:00
Sergey Biryukov c43a62bde7 Include placeholder in translator comment.
See #31863.

git-svn-id: https://develop.svn.wordpress.org/trunk@34306 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-18 19:02:37 +00:00