Commit Graph

39974 Commits

Author SHA1 Message Date
Gary Pendergast
008630e97a Docs: Update some function docs and signatures.
- Update the `_wp_specialchars()` docs to match the function signature.
- Update the `human_time_diff()` function signature to match the docs.

Props subrataemfluence.
Fixes #46845.



git-svn-id: https://develop.svn.wordpress.org/trunk@45586 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-02 01:44:06 +00:00
Gary Pendergast
8298f9dad0 Clean up stray <p> tags added by wpautop() inside block level tags.
`autop()` can sometimes get confused and not clean up stray `<p>` or `</p>` tags inside block level elements, which produces sub-optimal HTML. While browsers can generally handle it, there's no need to make things harder for them if we don't have to.

Props pento, ayubi, pbearne, jond, azaozz, 1994rstefan, dionysous, MikeHansenMe, jorbin, miqrogroove, niallkennedy.
Fixes #27350.




git-svn-id: https://develop.svn.wordpress.org/trunk@45585 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-02 01:30:15 +00:00
Adam Silverstein
b97899a07f Taxonomy: add a new 'terms_pre_query' filter to short circuit WP_Term_Query 'get_terms' queries.
Add a new `terms_pre_query` filter which returns null by default. Return a non-null value to bypass WordPress's default `get_terms` queries.

Props jarocks, boonebgorges, spacedmonkey.
Fixes #41246.



git-svn-id: https://develop.svn.wordpress.org/trunk@45584 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 20:47:21 +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
5fe76184f2 Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in the base directory.
See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45582 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 08:26:25 +00:00
Gary Pendergast
99e5c1e9ed Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in the default themes.
See #47632



git-svn-id: https://develop.svn.wordpress.org/trunk@45581 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 08:22:31 +00:00
Gary Pendergast
ef5a9dfda6 Coding Standards: Fix/ignore the WordPress.NamingConventions.ValidFunctionName violations.
See #47632



git-svn-id: https://develop.svn.wordpress.org/trunk@45580 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 08:00:12 +00:00
Gary Pendergast
d2c4198623 Multisite: Use size_format() in display_space_usage().
Deleted code is the best code.

Fixes #28239.



git-svn-id: https://develop.svn.wordpress.org/trunk@45579 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 03:46:30 +00:00
Gary Pendergast
78e096fe98 Formatting: Trim leading whitespace in esc_url().
Props toszcze.
Fixes #36369.



git-svn-id: https://develop.svn.wordpress.org/trunk@45578 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 03:28:21 +00:00
Gary Pendergast
77f9bf0aeb Formatting: Don't add <p> tags inside <svg> tags.
Inline `<svg>`s should generally work, as browsers should just ignore `<p>` or `<br/>` tags that shouldn't be inside the `<svg>`. To keep things neat, however, it's better not add them in the first place.

Props jared_smith, nacin, pento.
Fixes #9437.



git-svn-id: https://develop.svn.wordpress.org/trunk@45577 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 03:18:28 +00:00
Sergey Biryukov
b87bdbe9ba Twenty Seventeen: Correct the CSS selectors intended to fix hover colors for MediaElement controls.
This is a follow-up to the previous fix in [45146], which didn't work as expected.

Props ryokuhi.
Fixes #47543. See #40843.

git-svn-id: https://develop.svn.wordpress.org/trunk@45576 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-29 00:50:55 +00:00
Riad Benguella
ed1233d05f Build/Test Tools: Fix the hello e2e test assertion.
The previous assertion was always valid because we assumed it returned a single object,
while in reality it was returning an array.

Props hideokamoto.
Fixes #47622.


git-svn-id: https://develop.svn.wordpress.org/trunk@45575 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-28 11:33:13 +00:00
Gary Pendergast
77764a5754 Formatting: Add correct <p> tags near <hr> tags.
It can be tricky to know when `wpautop()` should add `<p>` tags, but one thing we can be certain about is that they really shouldn't be anywhere near `<hr>` tags.

Now they aren't.

Props solarissmoke, MattyRob, pento.
Fixes #14674.



git-svn-id: https://develop.svn.wordpress.org/trunk@45574 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-28 07:15:31 +00:00
Gary Pendergast
b9cd66f483 Formatting: Add support for seconds to human_time_diff().
The web has gotten so much faster since `human_time_diff()` was created, we need to be able to measure time differences with much finer granularity. Now, we can.

Props johnjamesjacoby, pento.
Fixes #35655.



git-svn-id: https://develop.svn.wordpress.org/trunk@45573 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-28 06:43:27 +00:00
Andrea Fercia
66d9c7e491 Accessibility: Make the Media modal an ARIA modal dialog.
For a number of years, the Media modal missed an explicit ARIA role and the required attributes for modal dialogs.

This was confusing for assistive technology users, since they may not realize they're inside a dialog, and that consequently the keyboard interactions may be different from the rest of the page. Lack of an explicit label for the dialog was confusing as well, since assistive technology users didn't have an immediate sense of what the dialog is for.

This change makes the Media modal meet the ARIA Authoring Practices recommendations, helping users better understand the purpose and interactions with the modal. Also, it makes sure to hide the rest of the page content from assistive technologies, until support for `aria-modal="true"` improves.

Additionally:
- moves the modal H1 heading to the beginning of the modal content 
- changes the modal left menu position to make visual and DOM order match 
- improves the `wp.media.view.FocusManager` documentation

Fixes #47145.


git-svn-id: https://develop.svn.wordpress.org/trunk@45572 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-27 12:32:28 +00:00
Riad Benguella
f8228d3116 Build/Test Tools: Make the local env scripts executable.
See #45165.


git-svn-id: https://develop.svn.wordpress.org/trunk@45571 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-27 12:05:44 +00:00
Riad Benguella
42a8715471 Build/Test Tools: Add the e2e tests setup.
- Adds a local environment based on docker
 - Adds the e2e tests setup
 - Adds a "Hello World" e2e test to serve as a template

Props gziolo, herregroen, mcsf.
Fixes #45165.


git-svn-id: https://develop.svn.wordpress.org/trunk@45570 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-27 11:26:58 +00:00
Gary Pendergast
3202f9f37e Formatting: Don't convert smilies in ignored tags that have attributes.
Smilies in ignored tags are not supposed to be converted to emoji, but this can malfunction if the tag has attributes. For example, the Preformatted block with add a `class` to the `<pre>` tag.

Props pento, jikamens.
Fixes #47489.



git-svn-id: https://develop.svn.wordpress.org/trunk@45569 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-27 02:04:17 +00:00
Sergey Biryukov
4512e94f9c Users: Pass $length, $special_chars, and $extra_special_chars parameters to the random_password filter in wp_generate_password().
Props roytanck.
Fixes #47092.

git-svn-id: https://develop.svn.wordpress.org/trunk@45568 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-27 00:47:41 +00:00
Sergey Biryukov
115c496a9a Docs: Correct @since for admin/edit-comments.js, introduced in [3736].
See #47581.

git-svn-id: https://develop.svn.wordpress.org/trunk@45567 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-26 18:18:21 +00:00
Sergey Biryukov
5118e5e266 REST API: Call WP_REST_Server::get_compact_response_links() and ::get_raw_data() static methods the right way.
Props andizer, TimothyBlynJacobs.
Fixes #47578.

git-svn-id: https://develop.svn.wordpress.org/trunk@45566 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-26 18:06:32 +00:00
John Blackbourn
fc10b6bbcd Docs: Correct and improve the docs for a few nonce-related functions.
See #47110


git-svn-id: https://develop.svn.wordpress.org/trunk@45565 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-25 17:06:57 +00:00
Andrew Ozz
ec44c57afa Editor: Fix undefined $locked var in edit-form-blocks.php when the show_post_locked_dialog filter is used to disable displaying of the dialog.
Props aprea.
Fixes #47604.

git-svn-id: https://develop.svn.wordpress.org/trunk@45564 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-25 15:02:34 +00:00
Andrea Fercia
725c77a13d Plugins: Fix the plugin details modal layout after [45520].
Props mukesh27, marybaum, audrasjb.
Fixes #47561.


git-svn-id: https://develop.svn.wordpress.org/trunk@45563 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-25 14:10:29 +00:00
Peter Wilson
6ee8a99b6a Cron: Fix condition reversed in [45559].
In [45559] a test for not-falsey was reversed to a falsey check.

Props obenland.
Fixes #47589.


git-svn-id: https://develop.svn.wordpress.org/trunk@45562 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-22 13:42:58 +00:00
Anton Timmermans
3099359887 Docs: Improve JSDoc for media/views/attachment/details.js.
Props maartenleenders, boblinthorst, dfangstrom.
Fixes #47588.


git-svn-id: https://develop.svn.wordpress.org/trunk@45561 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-22 13:01:22 +00:00
Peter Wilson
183b4b6212 Cron API: Prevent caching of WP Cron requests.
Add `Cache-Control` and `Expires` HTTP headers to prevent caching of requests to WP Cron on systems supporting fastcgi_finish_request(). 

The fastcgi_finish_request() call prevents the setting of further HTTP headers by caching plugins subsequently loaded.

Props kingkero.
Fixes 47396.



git-svn-id: https://develop.svn.wordpress.org/trunk@45560 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-22 11:12:58 +00:00
Peter Wilson
e37aff4320 Code is Poetry: CS Fixes required in wp-cron.php.
See #47396, #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@45559 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-22 11:11:26 +00:00
Anton Timmermans
a912ef9642 Docs: Improve JSDoc for admin/edit-comments.js.
Props manuelaugustin, diedeexterkate, thulshof, Xyfi, ireneyoast.
Fixes #47581.


git-svn-id: https://develop.svn.wordpress.org/trunk@45558 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-20 14:44:30 +00:00
Adam Silverstein
0dc3295e29 Themes: improve search by trimming search string.
Fix an issue where searching installed themes for an empty string resulted in matching all themes.

Props afercia, desrosj, hesyifei, evalarumbe.
Fixes #39041.


git-svn-id: https://develop.svn.wordpress.org/trunk@45557 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-20 14:14:59 +00:00
Sergey Biryukov
e9fc71bbbe Date/Time: Eliminate use of date_default_timezone_set() for determining DST status on General Options screen.
Time calculations should not need to rely on manipulating global PHP configuration state.

Props Rarst.
Fixes #46483.

git-svn-id: https://develop.svn.wordpress.org/trunk@45556 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-20 14:10:44 +00:00
Sergey Biryukov
e283457e45 Date/Time: Add more supported formats to wp_maybe_decline_date().
Props SergeyBiryukov, Rarst.
Fixes #37411.

git-svn-id: https://develop.svn.wordpress.org/trunk@45555 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-20 13:46:20 +00:00
Jonathan Desrosiers
97b90a454c XML-RPC: Merge similar translation strings.
Props ramiy.
Fixes #47039.

git-svn-id: https://develop.svn.wordpress.org/trunk@45554 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-20 12:52:52 +00:00
Anton Timmermans
7a9af3a4ed Comments: Open comment quick edit on double click.
In [42767] the quick edit button changed from a link to a button. This caused the jQuery code that selects on a link to no longer work. This commit restores the previous behavior.

Fixes #47572.
See #43382, #38677.


git-svn-id: https://develop.svn.wordpress.org/trunk@45553 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-20 10:05:03 +00:00
Jonathan Desrosiers
52f5768db6 Help/About: Improve wording of PHP Error Protection section.
Props pedromendonca, garrett-eclipse.
See #47475.
Fixes #47538.

git-svn-id: https://develop.svn.wordpress.org/trunk@45551 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-20 09:51:31 +00:00
Sergey Biryukov
1f1cf751e5 Plugins: When validating plugin's WordPress and PHP requirements, check for Requires at least and Requires PHP headers in the plugin's main PHP file.
This allows for blocking plugin activation if it requires a higher version of PHP or WordPress, and does not have a `readme.txt` file.

If the headers are defined in both `readme.txt` and the main plugin file, precedence is given to the plugin file.

Props afragen, Otto42, Ipstenu.
Fixes #46938.

git-svn-id: https://develop.svn.wordpress.org/trunk@45546 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-18 03:23:53 +00:00
Sergey Biryukov
44bd6e5615 Bootstrap/Load: Set expiration of the recovery mode cookie to the same amount of time for which the token in it is valid: a week by default.
Props david.binda, TimothyBlynJacobs.
Fixes #47480.

git-svn-id: https://develop.svn.wordpress.org/trunk@45545 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-17 19:16:16 +00:00
Sergey Biryukov
2a039d481e Bootstrap/Load: Return a 403 error code when the recovery mode cookie is invalid or expired, or the exit recovery mode nonce check failed.
Props david.binda, spacedmonkey.
Fixes #47479.

git-svn-id: https://develop.svn.wordpress.org/trunk@45544 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-17 18:36:28 +00:00
Andrew Ozz
5e26728387 Media: Ignore errors coming from image_resize_dimensions() when creating sub-sizes (for now). It returns false when the requested size is larger than the original image and should be skipped. This triggers new WP_Error in WP_Image_Editor::resize().
See #40439.

git-svn-id: https://develop.svn.wordpress.org/trunk@45543 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-16 01:32:16 +00:00
Sergey Biryukov
69fabdbd4d I18N: Merge duplicate strings in notifications displayed when a new user has been created or added to the site.
Props ramiy.
Fixes #35746.

git-svn-id: https://develop.svn.wordpress.org/trunk@45542 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-15 18:56:47 +00:00
Andrew Ozz
31d865271b Media: fix support for arrays for the crop setting for registered image sub-sizes in wp_get_registered_image_subsizes().
See #40439.

git-svn-id: https://develop.svn.wordpress.org/trunk@45541 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-15 17:16:27 +00:00
Andrew Ozz
815e3ffbe6 After [45538]: fix another WPCS "strict comparison" fix.
Props birgire.
See #40439.

git-svn-id: https://develop.svn.wordpress.org/trunk@45540 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-15 16:23:28 +00:00
Andrew Ozz
cd86b07108 After [45538]: fix a WPCS fix and make couple of var names consistent.
See #40439.

git-svn-id: https://develop.svn.wordpress.org/trunk@45539 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-15 01:31:07 +00:00
Andrew Ozz
ca84ae5030 Save progress of intermediate image creation after upload. First run.
- Introduces `wp_get_missing_image_subsizes()` and `wp_update_image_subsizes()` to generate image sub-sizes that are missing or were not created after the upload.
- Adds a way to display errors that happened while creating sub-sizes.
- Introduces `wp_create_image_subsizes()` intended for use after an image was uploaded. It saves/updates the image metadata immediately after each sub-size is created. This fixes the (long standing) problem when some of the sub-size image files were created but there was a timeout or an error and the metadata was not saved. Until now such uploads were considered "failed" which usually resulted in the user trying to upload the same image again, creating even more "orphan" image files.

Note that the patch also includes some unrelated WPCS fixes.

Props mikeschroder, azaozz.
See #40439.

git-svn-id: https://develop.svn.wordpress.org/trunk@45538 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-15 01:01:48 +00:00
Sergey Biryukov
8e7a6b298d Menus: Set better default for $args parameter in Walker_Nav_Menu methods, to match the documented parameter type.
Props trasweb.
Fixes #47524.

git-svn-id: https://develop.svn.wordpress.org/trunk@45537 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-14 11:25:45 +00:00
Sergey Biryukov
7283555663 Administration: Adjust code for "Manage widgets or menus" item on "Welcome to WordPress" panel to avoid an extra space after [42343].
Props Presskopp, davidbaumwald.
Fixes #47536.

git-svn-id: https://develop.svn.wordpress.org/trunk@45536 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-14 00:28:54 +00:00
Jonathan Desrosiers
8e8402092a Docs: Fix typos in Services_JSON DocBlocks.
Props mukesh27.
Fixes #47401.

git-svn-id: https://develop.svn.wordpress.org/trunk@45535 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-13 19:18:55 +00:00
Andrew Ozz
e153f957ad Fix displaying of the "An updated version of WordPress is available." notice when running the latest nightly build. Note that it is still displayed when running a local build or from /src.
Props afragen, audrasjb, SergeyBiryukov.
Fixes #45202.

git-svn-id: https://develop.svn.wordpress.org/trunk@45532 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-13 16:42:18 +00:00
Andrea Fercia
5eb394329a Accessibility: Handle one more case of focus loss when switching view in the Media Views.
See #43169.


git-svn-id: https://develop.svn.wordpress.org/trunk@45531 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-13 16:21:49 +00:00
Andrew Ozz
f16752240c Add a Recovery Mode Exit button to the notice. This fixes it in responsive view.
Props desrosj, karmatosed, chetan200891, afercia, afragen, garrett-eclipse.
Fixes #47070.

git-svn-id: https://develop.svn.wordpress.org/trunk@45529 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-13 15:59:58 +00:00