Commit Graph

55 Commits

Author SHA1 Message Date
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 10e13daccb Coding Standards: Use strict comparison in `wp-admin/edit.php`.
Props davidbaumwald.
Fixes #47201.

git-svn-id: https://develop.svn.wordpress.org/trunk@45759 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-07 11:40:00 +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 6acb0c6402 Coding Standards: Fix all `WordPress.WhiteSpace.PrecisionAlignment` issues.
See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45602 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-05 05:20:52 +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 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 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
Jonathan Desrosiers 15fa394a01 Block Editor: Fix the WordPress packages and vendor script registration.
The version is set properly and the scripts are automatically loaded in the footer.

This patch also includes a revert for the reusable blocks enqueue script.

Props pento, swissspidy, youknowriad.

Merges [43942] into trunk.

Fixes #45402.
See #45396.

git-svn-id: https://develop.svn.wordpress.org/trunk@44277 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 19:33:09 +00:00
Jonathan Desrosiers d2ed5529b8 Block Editor: Fix loading the script handling the "Manage Reusable Blocks" page.
This ensures the "import from JSON" and "export JSON" buttons are shown properly. The script is loaded in the footer because it relies on the DOM being already there.

Props noisysocks, mukesh27.

Merges [43936] into trunk.

Fixes #45396.

git-svn-id: https://develop.svn.wordpress.org/trunk@44274 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 19:07:35 +00:00
jeremyfelt 67b1a86c40 Blocks: Include necessary labels for the 'wp_block' post type.
Merges [43849] from the 5.0 branch to trunk.

Props danielbachhuber.
See #45098.


git-svn-id: https://develop.svn.wordpress.org/trunk@44215 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 01:24:01 +00:00
Jeremy Felt 6a84afa33c Blocks: Add the reusable block post type, `wp_block`.
Merges [43804] from the 5.0 branch to trunk.

See #45098.


git-svn-id: https://develop.svn.wordpress.org/trunk@44146 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 02:14:13 +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
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
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 a37269ee4a Posts, Post Types: Preserve author filter in list table after entering a page number in paging input.
Props sagarprajapati.
Fixes #39523.

git-svn-id: https://develop.svn.wordpress.org/trunk@39938 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-21 02:20:38 +00:00
Andrea Fercia cc6925d1d5 Accessibility: Remove inappropriate content from the Posts and Edit screens headings.
Props grahamarmfield, SergeyBiryukov, trishasalas, valendesigns, rianrietveld, afercia.

See #26601.


git-svn-id: https://develop.svn.wordpress.org/trunk@38983 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-27 20:38:09 +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
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
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 8d81483b5e I18N: Combine two duplicate "Invalid post type" strings.
Props @ramiy.
See #18218.

git-svn-id: https://develop.svn.wordpress.org/trunk@38076 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-17 16:04:50 +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
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
Andrea Fercia 18ef7d6225 Accessibility: Help text improvements.
Avoid references to "visual" positions in favour of positions in the document
structure. The help text shouldn't assume users can see.

Also, in the Posts screen don't mention specific types of posts and use a more
generic text instead.

Props odysseygate, pansotdev, zakb8.
Fixes #34761.

git-svn-id: https://develop.svn.wordpress.org/trunk@37680 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-10 21:42:05 +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
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
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
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
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 a923d36085 Remove the ability to view the post listing screen and post editing screen for post types 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_post_type()` should be altered so that `show_ui` is `true`, and arguments such as `show_in_menu`, `show_in_nav_menus`, and `show_in_admin_bar` are `false`.

Fixes #33763
Props swissspidy, johnbillion


git-svn-id: https://develop.svn.wordpress.org/trunk@34177 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-15 10:26:22 +00:00
Sergey Biryukov 50224510ec Provide more helpful feedback than just "Cheatin' uh?" for permission errors in `wp-admin/edit.php`.
props ericlewis, kraftbj, lukecarbis, mrmist.
fixes #33671. see #14530.

git-svn-id: https://develop.svn.wordpress.org/trunk@33861 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-02 18:14:14 +00:00
Scott Taylor 3b8c5529cb `foreach` is a statement, not a function.
See #33491.


git-svn-id: https://develop.svn.wordpress.org/trunk@33734 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-25 20:27:56 +00:00
Konstantin Obenland 8d40cdcb1b Use a less element-specific class name for links within page titles.
After [32974] these links are no longer within an `h2`, making the class name
inaccurate. `add-new-h1` has the potential to expose the same problem for in a
possible future change.

Fixes #31650.



git-svn-id: https://develop.svn.wordpress.org/trunk@33067 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-03 16:41:18 +00:00
Konstantin Obenland e59592f87e 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@32974 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-27 15:40:27 +00:00
Scott Taylor 23ce2efd12 Add `@global` annotations for `wp-admin/*`.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32642 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-28 21:40:27 +00:00
Dominik Schilling (ocean90) b0d6757918 Use HTTPS URLs for codex.wordpress.org.
see #27115.

git-svn-id: https://develop.svn.wordpress.org/trunk@32116 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-12 21:28:58 +00:00
Helen Hou-Sandi 35df5592f1 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@31973 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-01 22:05:17 +00:00
Sergey Biryukov 0d55562fd7 Decouple strings where the singular and plural form are not just the same string with different numbers, but essentially two different strings.
This allows for using proper plural forms in languages with more than two forms, and also resolves string conflicts when the same string is present in both singular and plural form.

fixes #28502.

git-svn-id: https://develop.svn.wordpress.org/trunk@31941 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-31 18:44:46 +00:00
Sergey Biryukov c29e63fdf7 Restore `<title>` tag on Posts and Pages screens after [31696].
fixes #31349.

git-svn-id: https://develop.svn.wordpress.org/trunk@31709 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-11 00:48:56 +00:00
Dominik Schilling (ocean90) 3bb3d2f1a5 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@31696 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-10 15:31:54 +00:00
Scott Taylor 83b6fad852 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@31200 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 04:15:52 +00:00
Scott Taylor 77cffd8edf 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@31121 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-10 05:28:46 +00:00
John Blackbourn 4e1e4745ff Switch to a `403` response code in places where it is more appropriate than a `500` due to permissions errors.
Fixes #10551
Props nacin


git-svn-id: https://develop.svn.wordpress.org/trunk@30356 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-16 06:15:29 +00:00
Scott Taylor c8acddfdc8 Improve some `post_status`-related documentation.
Props ericlewis.
See #30230.


git-svn-id: https://develop.svn.wordpress.org/trunk@30155 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-01 20:19:26 +00:00
Andrew Ozz 2ba822f6f1 Script-loader: remove 'heartbeat' dependency for post.js and inline-edit-post.js, fix dependencies for autosave.js. Fixes #30008
git-svn-id: https://develop.svn.wordpress.org/trunk@29989 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-22 03:40:13 +00:00
Scott Taylor 121726df31 `edit.php?post_type=attachment` should redirect to `upload.php`. Without the redirect, the user is presented with an empty list table. There are probably other issues to address overall, but this accomplishes what the ticket wants.
Props knutsp.
Fixes #27951.


git-svn-id: https://develop.svn.wordpress.org/trunk@28729 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-10 18:47:57 +00:00
Andrew Nacin 4cf6fc1a99 Use SSL when linking to WordPress.org. see #27115.
git-svn-id: https://develop.svn.wordpress.org/trunk@27469 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-08 04:13:28 +00:00