Commit Graph

40188 Commits

Author SHA1 Message Date
Andrea Fercia
aed8c497cb Accessibility: Improve focus styles for legacy modal dialogs powered by jQuery UI.
Fixes #47944.


git-svn-id: https://develop.svn.wordpress.org/trunk@45931 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-02 21:48:29 +00:00
Andrea Fercia
e12f3793d5 Accessibility: Audit usage of abbreviations.
Title attributes on abbreviations are only available to a minority of users. The
best option is to avoid unnecessary abbreviations when possible. In the other cases,
use an `<abbr>` element (which provides a hint to user agents on how to announce
and display the abbreviation) and provide an expansion in plain text on first use.

- `readme.html`: improves abbreviations and removes unnecessary `title` attributes
- options-general: removes unnecessary abbreviations and improves the remaining ones
- customizer schedule changeset date: removes unnecessary abbreviations and improves the remaining ones
- posts table date: uses a `span` element instead of an `abbr` element because this is not an abbreviation

Fixes #46980.


git-svn-id: https://develop.svn.wordpress.org/trunk@45930 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-02 21:43:39 +00:00
Felix Arntz
ac2df4e8db Formatting: Improve accuracy of force_balance_tags() and add support for custom element tags.
This changeset includes a major iteration on the regular expression used to balance tags, with comprehensive test coverage to ensure that all scenarios are supported or unsupported as expected.

Props dmsnell, westonruter, birgire.
Fixes #47014.


git-svn-id: https://develop.svn.wordpress.org/trunk@45929 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-02 10:24:18 +00:00
Peter Wilson
122cb2864b #43590: Use robots meta tag to better discourage search engines.
This changes the "discourage search engines" option to output a `noindex, nofollow` robots meta tag. `Disallow: /` is removed from the `robots.txt` to allow search engines to discover they are requested not to index the site.

Disallowing search engines from accessing a site in the `robots.txt` file can result in search engines listing a site with a fragment (a listing without content).

Props donmhico, jonoaldersonwp.
Fixes #43590.



git-svn-id: https://develop.svn.wordpress.org/trunk@45928 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-02 02:26:55 +00:00
Sergey Biryukov
d0db5be1fe I18N: Split translatable strings located on the same line preceded with a translator comment, where the first string needs that comment, but the second does not.
Props johnbillion.
See #44360.

git-svn-id: https://develop.svn.wordpress.org/trunk@45927 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-02 00:42:01 +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
Andrea Fercia
425d6fd925 Accessibility: Add a default title for the media modal dialog.
Makes sure the media modal dialog `h1` heading isn't empty when custom media frames don't set a title. This is particularly important now that the media modal is an ARIA dialog, as the title is referenced by an `aria-labelledby` attribute to properly label the dialog.

Props donmhico, audrasjb.
Fixes #47612.


git-svn-id: https://develop.svn.wordpress.org/trunk@45925 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-01 15:17:37 +00:00
Sergey Biryukov
e2b68a4253 Docs: Improve documentation for auth_redirect().
Props atachibana.
Fixes #47956.

git-svn-id: https://develop.svn.wordpress.org/trunk@45924 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-01 13:02:29 +00:00
Sergey Biryukov
27c877e2b9 Twenty Nineteen: Remove unused jQuery argument passed to an IIFE that accepts no arguments.
Props Christian1012, hareesh-pillai.
Fixes #40333.

git-svn-id: https://develop.svn.wordpress.org/trunk@45923 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-31 20:52:07 +00:00
Sergey Biryukov
08a91859dd Twenty Seventeen: Remove unused jQuery argument passed to an IIFE that accepts no arguments.
Props Christian1012, hareesh-pillai.
See #40333.

git-svn-id: https://develop.svn.wordpress.org/trunk@45922 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-31 20:51:45 +00:00
Sergey Biryukov
9abbd90d30 Twenty Nineteen: Correct file name in JS DocBlocks.
See #47110.

git-svn-id: https://develop.svn.wordpress.org/trunk@45921 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-31 20:42:27 +00:00
Sergey Biryukov
9445634e0c Twenty Nineteen: Improve compatibility with custom colors in the separator block.
Props kjellr.
Fixes #47811.

git-svn-id: https://develop.svn.wordpress.org/trunk@45920 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-30 19:14:23 +00:00
Sergey Biryukov
6f22a931ff Twenty Nineteen: Remove Baskerville Old Face from the font stack due to several shortcomings:
* Being difficult to read due to its mix of thin and thick strokes.
* Having poor language/extended character support.
* Not having other weights/styles (bold, italic, etc) and relying on browser approximations of those variants.

The next fonts down the stack (Garamond and Times) are more properly aligned to the appearance of the top-level serif font in the stack (Hoefler Text), and work better in its place.

Props kjellr, Rarst, justintadlock.
Fixes #45881.

git-svn-id: https://develop.svn.wordpress.org/trunk@45919 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-30 18:57:51 +00:00
Sergey Biryukov
5377bc484b Comments: In AJAX response when deleting a comment, account for &nbsp; as a thousands separator in total_items_i18n and total_pages_i18n numbers.
Props denisco, SergeyBiryukov.
Fixes #47953.

git-svn-id: https://develop.svn.wordpress.org/trunk@45918 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-30 18:32:14 +00:00
Sergey Biryukov
3a0faad226 Docs: Simplify get_plugin_data() and get_file_data() description.
See #47110.

git-svn-id: https://develop.svn.wordpress.org/trunk@45917 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-30 16:56:39 +00:00
Sergey Biryukov
b36feb1b5d Docs: Update plugin headers example in get_plugin_data() to clarify that Version is not a required field.
Props casiepa.
See #47110, #meta4707.

git-svn-id: https://develop.svn.wordpress.org/trunk@45916 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-30 16:15:32 +00:00
John Blackbourn
ab7c365819 Docs: Correct and improve inline docs relating to caching, terms, meta, and some misc tweaks.
See #47110   


git-svn-id: https://develop.svn.wordpress.org/trunk@45915 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-30 11:34:11 +00:00
Sergey Biryukov
56d4e7fb86 Date/Time: Restore the previous behavior of date_i18n() where invalid input would result in current time.
Make `wp_date()` return `false` on invalid timestamp input, for consistency with upstream PHP `date()` function.

Props Rarst.
Fixes #28636.

git-svn-id: https://develop.svn.wordpress.org/trunk@45914 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-29 23:17:30 +00:00
Sergey Biryukov
07ec966f17 I18N: Add missing translator comment in help text on Reading Settings screen.
Props garrett-eclipse.
See #46708.

git-svn-id: https://develop.svn.wordpress.org/trunk@45913 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-29 21:36:00 +00:00
Sergey Biryukov
e9d1a9a539 Administration: Add a note to "For each post in a feed, include [Full text / Summary]" option that how content is displayed in browsers depends on the theme.
Add a documentation link to learn more about feeds.

Props JarretC, SergeyBiryukov, pento, talldanwp, dinhtungdu, noisysocks, tobifjellner.
Fixes #46708.

git-svn-id: https://develop.svn.wordpress.org/trunk@45912 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-29 21:24:46 +00:00
Sergey Biryukov
355d93d977 Date/Time: Update XML-RPC tests for invalid date input to account for a more consistent mysql2date() error handling in [45908].
The tests were meant to check for the lack of a fatal error in case of invalid date input, not specifically mark a particular outcome as the correct one.

Props Rarst.
Fixes #28992.

git-svn-id: https://develop.svn.wordpress.org/trunk@45911 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-29 16:43:28 +00:00
Felix Arntz
4572bb0988 Multisite: Improve performance by caching not found lookups for sites and networks.
With this change, the result of a site or network lookup by ID will be cached even if the ID does not exist. When a new site or network is created, the cache for the respective new ID is cleared.

Props mnelson4, nielsdeblaauw.
Fixes #42251.


git-svn-id: https://develop.svn.wordpress.org/trunk@45910 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-29 12:41:45 +00:00
Mike Schroder
65f3124283 Administration: Output valid HTML when wp_die() is called.
To better support HTML and string calls to `wp_die()` without
outputting invalid HTML, wraps error messages in `<div>` rather than `<p>`.

Adds `.wp-die-message` CSS class for styling.

Props dinhtungdu, jeremyfelt, audrasjb, SergeyBiryukov, afercia, audrasjb, noisysocks.
Fixes #47580.

git-svn-id: https://develop.svn.wordpress.org/trunk@45909 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-29 07:52:43 +00:00
Sergey Biryukov
71697aefc0 Date/Time: Revamp mysql2date() to use wp_date() and handle invalid input in a consistent manner.
Add unit tests, improve documentation.

Props Rarst, pbearne.
Fixes #28992.

git-svn-id: https://develop.svn.wordpress.org/trunk@45908 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-29 05:06:15 +00:00
Sergey Biryukov
f490fb924d Coding Standards: Fix WPCS issue in [45906].
See #45322.

git-svn-id: https://develop.svn.wordpress.org/trunk@45907 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-29 02:39:21 +00:00
Sergey Biryukov
c3e89c2190 XML-RPC: Make sure editing a draft post with wp.editPost does not unintentionally cause its published date to be set.
Props redsweater.
Fixes #45322.

git-svn-id: https://develop.svn.wordpress.org/trunk@45906 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-29 02:09:42 +00:00
Sergey Biryukov
5a1e3649c4 Site Health: Merge two similar strings explaining what drop-in plugins are.
Props garrett-eclipse, ramiy, Clorith.
Fixes #47247.

git-svn-id: https://develop.svn.wordpress.org/trunk@45905 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-28 03:12:09 +00:00
Sergey Biryukov
83efbc67e3 Site Health: Standardize on SELECT VERSION() query for checking the database server version, due to the MariaDB version declaration potentially causing issues in production environments.
Partially reverts [45691].

Props Clorith.
Fixes #47738.

git-svn-id: https://develop.svn.wordpress.org/trunk@45904 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-28 03:07:59 +00:00
K. Adam White
2d0cb482ed REST API: Only cast scalar types to string when comparing new & old meta values.
Newly-supported array and object meta types should not be cast to strings.

Props TimothyBlynJacobs, caercam.
Fixes #47928.


git-svn-id: https://develop.svn.wordpress.org/trunk@45903 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-28 03:07:03 +00:00
Sergey Biryukov
dfe51f6069 Date/Time: Correct delta comparison in test_should_return_wp_timestamp().
See #25768.

git-svn-id: https://develop.svn.wordpress.org/trunk@45902 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-28 02:19:46 +00:00
Sergey Biryukov
a4723edc50 Date/Time: Introduce wp_date() to retrieve the date in localized format.
Convert `date_i18n()` into a wrapper for `wp_date()`.

`wp_date()` is intended as a replacement for `date_i18n()` without legacy quirks in it. It accepts a true Unix timestamp (not summed with timezone offset) and an arbitrary timezone.

Props Rarst, mboynes, MikeHansenMe, rmccue, nacin.
Fixes #28636.

git-svn-id: https://develop.svn.wordpress.org/trunk@45901 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-28 00:51:16 +00:00
Sergey Biryukov
6c8b425d71 Date/Time: Remove the last remaining current_time( 'timestamp' ) instance in wp_post_revision_title_expanded().
Timestamps don't carry any timezone information, using `$revision->post_modified_gmt` simplifies the logic.

Props Rarst.
See #40657.

git-svn-id: https://develop.svn.wordpress.org/trunk@45900 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-27 21:54:58 +00:00
Sergey Biryukov
dea752ab65 Docs: Clarify that $name and $value parameters of set_user_setting() can contain hyphens.
Props tmatsuur.
Fixes #47938.

git-svn-id: https://develop.svn.wordpress.org/trunk@45899 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-27 01:16:20 +00:00
Sergey Biryukov
62a87563d7 Docs: Remove a clarification from do_robots() description that doesn't really clarify anything.
See #47110.

git-svn-id: https://develop.svn.wordpress.org/trunk@45898 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-27 00:16:06 +00:00
Sergey Biryukov
ef69d4ba14 Twenty Nineteen: Make sure center-aligned images in columns do not break beyond the column boundaries.
Props kjellr.
Fixes #47937.

git-svn-id: https://develop.svn.wordpress.org/trunk@45897 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-26 19:00:46 +00:00
Sergey Biryukov
c8bd4cbae4 Twenty Nineteen: Update style-rtl.css after [45773].
See #47850.

git-svn-id: https://develop.svn.wordpress.org/trunk@45896 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-26 18:59:39 +00:00
Sergey Biryukov
144cb531fc Docs: Reference WP_Term_Query::__construct() in wp_list_categories() DocBlock for additional accepted arguments.
Clarify that `wp_dropdown_categories()` always returns a string, regardless of the `echo` parameter.

See #47896, #47110.

git-svn-id: https://develop.svn.wordpress.org/trunk@45895 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-26 16:59:53 +00:00
Boone Gorges
7dac24c681 Taxonomy: Standardize docs for wp_list_categories().
Many of the parameters historically documented on this function are merely
passed through to `get_categories()` and its underlying functions. In order to
avoid unnecessary duplication of function arguments, we remove documentation of
these parameters, and replace it with reference to the wrapped functions.

Parameters that receive special treatment or are otherwise changed before
being passed through continue to be documented as part of `wp_list_categories()`.

Props audrasjb, itowhid06, birgire.
Fixes #47896.

git-svn-id: https://develop.svn.wordpress.org/trunk@45894 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-26 15:23:48 +00:00
Boone Gorges
c2c8a6848d Taxonomy: Fix unique-slug check for terms with parents.
`wp_unique_term_slug()` appends numeric suffixes when the requested slug is
already in use by a sibling term. Changes introduced in [32837] inadvertently
caused this suffixing to be skipped in cases where the requested slug is
suffixed with the parent slug, so that it became possible to have two terms
`childslug-parentslug` underneath to the same `parentslug`. We fix this
regression by ensuring that the numeric-suffix routine runs in all cases.

Props yashar_hv, saskak, dlh.
Fixes #46431.

git-svn-id: https://develop.svn.wordpress.org/trunk@45893 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-26 15:18:40 +00:00
Andrew Ozz
152083be8f Docs: Improve and update the description of multi_resize() to explain changes and expected use.
See #40439.

git-svn-id: https://develop.svn.wordpress.org/trunk@45892 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-25 22:20:57 +00:00
Sergey Biryukov
252e14ac27 Menus: In wp_setup_nav_menu_item() and Walker_Nav_Menu_Edit::start_el(), check if the post or term associated with the menu item still exists to avoid a PHP notice.
If the associated post or term no longer exists, mark the menu item as invalid.

Props mehulkaklotar, kamrankhorsandi, cristiano.zanca, SergeyBiryukov.
Fixes #31703.

git-svn-id: https://develop.svn.wordpress.org/trunk@45891 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-25 21:31:43 +00:00
Sergey Biryukov
7ef2679ec7 Users: Adjust [45806] to make sure $all_userids is always defined.
Props kbrownkd.
Fixes #47936.

git-svn-id: https://develop.svn.wordpress.org/trunk@45890 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-25 20:02:31 +00:00
Sergey Biryukov
2e1de7309c Site Health: Add timezone to Site Health Info page.
Props justinahinon, sharaz, artisticasad, Rarst.
Fixes #47842.

git-svn-id: https://develop.svn.wordpress.org/trunk@45889 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-24 19:36:33 +00:00
Boone Gorges
3e704473e7 Taxonomy: Ensure consistency of hide_empty in term queries when taxonomy is excluded.
When querying for terms in hierarchical categories using `hide_empty=true`,
results have historically included parent terms which are themselves
unattached to any objects (are "empty") but which have non-empty descendent
terms. Because this process involves walking the descendant tree, we avoid it
when we detect that the queried taxonomies are not hierarchical. (This
behavior was introduced in [5525].)

When the `taxonomy` parameter of `get_terms()` was made optional - see #35495,
[36614] - it affected the mechanism for avoiding unneccessary tree walks,
since there may not be any explicitly declared taxonomies to run through
`is_taxonomy_hierarchical()`. As a result, term queries excluding `taxonomy`
did not check descendants, and empty parents with non-empty children were not
included in `hide_empty` results.

We correct the behavior by crawling term descendants when the `taxonomy`
argument is absent, which means that we're querying for terms in all taxonomies.

Props smerriman.
Fixes #37728.

git-svn-id: https://develop.svn.wordpress.org/trunk@45888 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-23 16:04:07 +00:00
Sergey Biryukov
ae2b4f9add Date/Time: Rewrite and simplify get_gmt_from_date(), get_date_from_gmt(), and iso8601_to_datetime() using wp_timezone().
Improve unit test coverage.

Props Rarst, goodevilgenius.
Fixes #31809.

git-svn-id: https://develop.svn.wordpress.org/trunk@45887 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-23 11:02:51 +00:00
Sergey Biryukov
b975a251ff Date/Time: Simplify the date comparing logic in WP_Community_Events::trim_events().
The Events API returns event date without timezone information, so trying to parse it into a timestamp and compare to a WP timestamp is pointless.

Props Rarst.
Fixes #47463.

git-svn-id: https://develop.svn.wordpress.org/trunk@45886 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-23 02:14:07 +00:00
Gary Pendergast
ece257ffd0 Build Tools: Pass the LOCAL_DIR environment variable through to the phpunit Docker container.
This allows code running inside the container to know whether it's supposed to be running in `build` or `src`.

See #47767.



git-svn-id: https://develop.svn.wordpress.org/trunk@45885 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-23 01:55:28 +00:00
Sergey Biryukov
ff36b9664f Date/Time: Revert unintended changes from [45882].
Props TimothyBlynJacobs.
See #25768.

git-svn-id: https://develop.svn.wordpress.org/trunk@45884 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-23 01:15:16 +00:00
Sergey Biryukov
1c66cf519b Date/Time: Introduce current_datetime() for better time operations.
Returning a `DateTimeImmutable` representation of the current moment in time, this allows for a more flexible and reliable use than `current_time()` provides.

Props Rarst.
Fixes #47464.

git-svn-id: https://develop.svn.wordpress.org/trunk@45883 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-23 01:11:22 +00:00
Sergey Biryukov
67f7d1f4c7 Date/Time: Rewrite and simplify date_i18n() using wp_timezone() to address multiple issues with certain date formats and timezones, while preserving some extra handling for legacy use cases.
Improve unit test coverage.

Props Rarst, remcotolsma, raubvogel.
Fixes #25768.

git-svn-id: https://develop.svn.wordpress.org/trunk@45882 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-23 00:56:21 +00:00