Commit Graph

40898 Commits

Author SHA1 Message Date
Sergey Biryukov 6cd0e35c6b I18N: Replace `rest_authentication_errors` filter name with a placeholder in a translatable string.
Follow-up to [38947] and [40038].

See #38446.

git-svn-id: https://develop.svn.wordpress.org/trunk@47044 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-06 16:19:51 +00:00
Sergey Biryukov b459cddeaf I18N: Replace `php.ini`, `post_max_size`, and `upload_max_filesize` with placeholders in "File is empty" error message.
Props ramiy.
Fixes #48868.

git-svn-id: https://develop.svn.wordpress.org/trunk@47043 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-06 16:14:30 +00:00
Dominik Schilling 086ae28f0e Docs: Remove duplicate inline comment in `wp_mail()`.
See [5639].
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47042 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-06 14:49:13 +00:00
Sergey Biryukov cd5b7df8b8 Docs: Improve documentation for `tests/phpunit/includes/testcase-ajax.php`.
Props andizer, SergeyBiryukov.
Fixes #47568.

git-svn-id: https://develop.svn.wordpress.org/trunk@47041 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-05 15:31:10 +00:00
Dominik Schilling 5f600eb32a Media: After [46375], enable JavaScript translations for the `media-views` script.
See #49134.

git-svn-id: https://develop.svn.wordpress.org/trunk@47040 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-05 13:09:52 +00:00
Sergey Biryukov 50ed776846 Docs: Fix typo in `media_post_single_attachment_fields_to_edit()` description.
Props mukesh27.
Fixes #49131.

git-svn-id: https://develop.svn.wordpress.org/trunk@47039 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-04 17:58:37 +00:00
Sergey Biryukov 0a6720af6b Coding Standards: Add missing braces to `if` conditions in `js/_enqueues/wp/customize/base.js`.
Props ankitmaru.
Fixes #49122.

git-svn-id: https://develop.svn.wordpress.org/trunk@47038 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-04 01:26:26 +00:00
K. Adam White 746502eaa9 REST API: Issue doing_it_wrong if a taxonomy's specified rest_base is already in use by a different resource.
Props fgiannar, TimothyBlynJacobs, kingkool68, SergeyBiryukov.
Fixes #48401.



git-svn-id: https://develop.svn.wordpress.org/trunk@47037 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-03 19:22:32 +00:00
K. Adam White 172e0b01c6 REST API: Short-circuit comment controller permissions check if commented-upon post type does not exist.
Props imani3011, dragosh635, subrataemfluence, timothyblynjacobs.
Fixes #42238.



git-svn-id: https://develop.svn.wordpress.org/trunk@47036 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-03 18:42:09 +00:00
Grzegorz (Greg) Ziółkowski a35e46a937 Build Tools: Integrate DependencyExtractionWebpackPlugin in the JS build.
This patch integrates DependencyExtractionWebpackPlugin which was battle-tested in Gutenberg. 

This will greatly simplify the process of upgrading npm packages which change after every Gutenberg release. It might even useful during the WordPress release cycle as we might need to publish more often as we discover critical bugs and regressions.

Props jonsurrell, adamsilverstein, youknowriad, ocean90, netweb.

Fixes #48154. 



git-svn-id: https://develop.svn.wordpress.org/trunk@47035 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-03 13:15:33 +00:00
Sergey Biryukov c27ab74ca9 REST API: Synchronize permission checks in `::get_items_permissions_check()` methods for post types, post statuses, and users:
* Only query post types with `'show_in_rest' => true` instead of looping over all post types and checking the `show_in_rest` property separately.
* Return from the `foreach()` loop as soon as the permission check succeeded.

Props pbiron, TimothyBlynJacobs, SergeyBiryukov.
Fixes #49118.

git-svn-id: https://develop.svn.wordpress.org/trunk@47034 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-03 02:26:36 +00:00
Sergey Biryukov adb9483563 Link Manager: Use a strict `in_array()` check in `wp-links-opml.php`.
Props dkarfa.
Fixes #49106.

git-svn-id: https://develop.svn.wordpress.org/trunk@47033 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-03 01:12:13 +00:00
Sergey Biryukov b773334bf2 Docs: Synchronize "Default empty array" notes for `$args` parameter in `get_comment_text()` and `comment_text()`.
Props denisco.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47032 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-02 19:20:33 +00:00
Sergey Biryukov 10d4ad91b0 Site Health: Fix typo in a variable name in `js/_enqueues/admin/site-health.js`.
Props nickylimjj.
Fixes #49112.

git-svn-id: https://develop.svn.wordpress.org/trunk@47031 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-02 12:09:27 +00:00
Sergey Biryukov 83defdf556 Coding Standards: Move assignment out of condition in `js/media/controllers/library.js`.
Props ankitmaru.
Fixes #49108.

git-svn-id: https://develop.svn.wordpress.org/trunk@47030 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-02 12:05:29 +00:00
Sergey Biryukov aaee49fb63 Coding Standards: Move assignment out of condition in `js/media/views/settings.js`.
Props ankitmaru.
Fixes #49107.

git-svn-id: https://develop.svn.wordpress.org/trunk@47029 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-02 12:00:11 +00:00
Sergey Biryukov f4346b9da6 Coding Standards: Use strict comparison in `wp-comments-post.php`.
Props dkarfa.
Fixes #49105.

git-svn-id: https://develop.svn.wordpress.org/trunk@47028 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-02 11:40:11 +00:00
Sergey Biryukov 3e47858a53 Coding Standards: Use strict comparison and Yoda conditions in `wp-includes/widgets.php`.
Props jenilk.
Fixes #49104.

git-svn-id: https://develop.svn.wordpress.org/trunk@47027 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-02 11:35:55 +00:00
Sergey Biryukov f4a8e840af Happy New Year!
Update copyright year to 2020 in bundled themes' `readme.txt`.

git-svn-id: https://develop.svn.wordpress.org/trunk@47026 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-01 03:51:29 +00:00
Sergey Biryukov 7bd615730d Happy New Year!
Update copyright year to 2020 in `license.txt`.

git-svn-id: https://develop.svn.wordpress.org/trunk@47025 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-01 02:17:53 +00:00
Sergey Biryukov c9a366e857 Docs: Fix typo in `_crop_image_resource()` DocBlock.
Props mukesh27.
Fixes #49103.

git-svn-id: https://develop.svn.wordpress.org/trunk@47024 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-31 12:32:19 +00:00
Sergey Biryukov ae53e417d5 Docs: Add missing descriptions and `@return` tags for `_WP_Editors::get_mce_locale()` and `::get_baseurl()`.
Props adnan.limdi.
Fixes #41869.

git-svn-id: https://develop.svn.wordpress.org/trunk@47023 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-31 01:29:42 +00:00
Sergey Biryukov fa0feb0cff Docs: Add missing `@since` tags for `wp-includes/class-wp-editor.php`.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47022 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-31 01:23:11 +00:00
Sergey Biryukov e2748f44f4 Docs: Fix typo in `.env` file description.
Props mujuonly, dkarfa.
Fixes #49095.

git-svn-id: https://develop.svn.wordpress.org/trunk@47021 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-30 13:46:17 +00:00
Sergey Biryukov 7b3483c866 Coding Standards: Fix WPCS issue in [47019].
See #49091.

git-svn-id: https://develop.svn.wordpress.org/trunk@47020 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-29 22:30:26 +00:00
Sergey Biryukov 1dfd6c5168 Twenty Twenty: Remove extra space from `arrow-down-circled` icon name in `TwentyTwenty_SVG_Icons::$ui_icons`.
Props kitchin.
Fixes #49091.

git-svn-id: https://develop.svn.wordpress.org/trunk@47019 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-29 20:43:04 +00:00
Sergey Biryukov ef6973b7f0 Bootstrap/Load: Make handling the `/favicon.ico` requests more flexible.
Previously, `wp_favicon_request()` was introduced in [13205] to avoid a performance hit of serving a full 404 page on every favicon request.

While working as intended, that implementation did not provide a way for theme or plugin authors to manage the behavior of favicon requests.

This changeset implements the following logic (only applied if WordPress is installed in the root directory):

* If there is a Site Icon set in Customizer, redirect `/favicon.ico` requests to that icon.
* Otherwise, use the WordPress logo as a default icon.
* If a physical `/favicon.ico` file exists, do nothing, let the server handle the request.

Handling `/favicon.ico` is now more consistent with handling `/robots.txt` requests.

New functions and hooks:

* Introduce `is_favicon()` conditional tag to complement `is_robots()`.
* Introduce `do_favicon` action to complement `do_robots` and use it in template loader.
* Introduce `do_favicon()` function, hooked to the above action by default, to complement `do_robots()`.
* Introduce `do_faviconico` action to complement `do_robotstxt`, for plugins to override the default behavior.
* Mark `wp_favicon_request()` as deprecated in favor of `do_favicon()`.

Props jonoaldersonwp, birgire, joostdevalk, mukesh27, SergeyBiryukov.
Fixes #47398.

git-svn-id: https://develop.svn.wordpress.org/trunk@47018 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-28 21:18:03 +00:00
Sergey Biryukov 85c7a64791 Docs: Improve `@return` description for `wp_update_comment()` and `WP_UnitTest_Factory_For_Comment::update_object()`.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47017 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-27 00:28:39 +00:00
Sergey Biryukov 004023d493 Coding Standards: Fix WPCS issue in [47015].
See #49082.

git-svn-id: https://develop.svn.wordpress.org/trunk@47016 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-26 15:51:33 +00:00
Sergey Biryukov c231e66c0a Docs: Fix typo in `wp_dashboard_cached_rss_widget()` documentation.
Props mukesh27.
Fixes #49082.

git-svn-id: https://develop.svn.wordpress.org/trunk@47015 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-26 14:40:10 +00:00
Sergey Biryukov 079580a6b7 Tests: Set `network_id` instead of `site_id` in `WP_UnitTest_Factory_For_Blog` defaults.
Follow-up to [47011], [47013].

See #47195.

git-svn-id: https://develop.svn.wordpress.org/trunk@47014 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-26 00:25:20 +00:00
Sergey Biryukov 93eeb8f1d7 Tests: Update legacy arguments passed to `WP_UnitTest_Factory_For_Blog::create_object()`.
This converts the arguments originally meant for `wpmu_create_blog()` to the ones used by `wp_insert_site()`.

Follow-up to [47011].

Fixes #47195.

git-svn-id: https://develop.svn.wordpress.org/trunk@47013 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-25 21:39:46 +00:00
Sergey Biryukov f8051662b1 Tests: Replace most instances of `wpmu_delete_blog()` not specifically testing that function with `wp_delete_site()`.
Follow-up to [47011].

See #47195.

git-svn-id: https://develop.svn.wordpress.org/trunk@47012 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-25 18:15:13 +00:00
Sergey Biryukov ebe75fb903 Tests: Switch `WP_UnitTest_Factory_For_Blog::create_object()` to use `wp_insert_site()`.
Map some arguments for backward compatibility with `wpmu_create_blog()` previously used there.

Props davidbaumwald, danielbachhuber, jeremyfelt, SergeyBiryukov.
See #47195.

git-svn-id: https://develop.svn.wordpress.org/trunk@47011 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-25 18:10:19 +00:00
Sergey Biryukov dbf6a0ba7c Media: Make sure `attachment_url_to_postid()` performs a case-sensitive search for the uploaded file name.
Previously, the first available match was returned, regardless of the case, which was not always the expected result.

Props archon810, ben.greeley, tristangemus, vsamoletov, SergeyBiryukov.
Fixes #39768.

git-svn-id: https://develop.svn.wordpress.org/trunk@47010 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-25 02:24:38 +00:00
Sergey Biryukov d56642ea57 Docs: Use a third-person singular verb for comment template function descriptions, per the documentation standards.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47009 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-24 16:17:17 +00:00
Sergey Biryukov 51b421a6d1 Docs: Improve documentation for `get_comment_author_url()`.
Props stevenlinx.
Fixes #49076.

git-svn-id: https://develop.svn.wordpress.org/trunk@47008 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-24 16:08:34 +00:00
Sergey Biryukov 67502b3dcd Docs: Correct the note about the `CORE_UPGRADE_SKIP_NEW_BUNDLED` constant in `$_new_bundled_files` global description.
In order to tell WordPress not to install new bundled themes on update, `CORE_UPGRADE_SKIP_NEW_BUNDLED` should be set to `true`, as the name suggests, not `false`.

Follow-up to [39064].

Props tomgreer, knutsp, crdunst.
See #49056.

git-svn-id: https://develop.svn.wordpress.org/trunk@47007 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-23 17:58:02 +00:00
Sergey Biryukov c273108570 Docs: Improve documentation for admin menu functions:
* `get_admin_page_parent()`
* `get_admin_page_title()`
* `get_plugin_page_hook()`
* `get_plugin_page_hookname()`
* `user_can_access_admin_page()`

Add missing descriptions and `@since` tags.

Props subrataemfluence, kennithnichol, stevenlinx, SergeyBiryukov.
Fixes #44253, #49067.

git-svn-id: https://develop.svn.wordpress.org/trunk@47006 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-23 14:34:10 +00:00
Sergey Biryukov 56e338c132 Upgrade/Install: When creating the `.htaccess` file in `insert_with_markers()`, make sure it has `0644` as a minimum set of permissions.
Props rcutmore, dd32, i3anaan.
Fixes #40572.

git-svn-id: https://develop.svn.wordpress.org/trunk@47005 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-22 02:43:30 +00:00
Sergey Biryukov 5c83f0630a Shortcodes: Introduce `apply_shortcodes()` as an alias for `do_shortcode()`.
This better aligns with the semantics of applying filters to the input and returning a result, rather than performing an action and outputting to the current buffer.

Props ljasinskipl, thefarlilacfield.
Fixes #37422.

git-svn-id: https://develop.svn.wordpress.org/trunk@47004 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-21 20:10:25 +00:00
Sergey Biryukov 7abc076e13 Shortcodes: Make sure `wp.shortcode.string()` accepts the `attrs` array keys in any order.
Props yale01, georgestephanis, adamsilverstein, zsusag, mircoraffinetti, SergeyBiryukov.
Fixes #36263.

git-svn-id: https://develop.svn.wordpress.org/trunk@47003 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-21 18:32:45 +00:00
Sergey Biryukov 939fbfa7d3 Administration: Add `doing_wp_cron` to `wp_removable_query_args()`.
It's a single-use URL parameter that does not need to be passed to canonical URLs in the admin.

Props dlh.
Fixes #49017.

git-svn-id: https://develop.svn.wordpress.org/trunk@47002 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-21 16:12:15 +00:00
Sergey Biryukov 2c15e0c286 Tests: Don't fail the test in `WP_UnitTestCase_Base::skipOnAutomatedBranches()` if Travis environment variables are unavailable, it prevents from running the test locally.
Follow-up to [47000].

See #49050.

git-svn-id: https://develop.svn.wordpress.org/trunk@47001 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-20 12:13:10 +00:00
Sergey Biryukov d697471bb1 Tests: Correct the check for pull requests in `WP_UnitTestCase_Base::skipOnAutomatedBranches()`.
Mark the test as failed if the environment variables are unavailable.

Fixes #49050.

git-svn-id: https://develop.svn.wordpress.org/trunk@47000 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-20 01:10:23 +00:00
Sergey Biryukov 2915793376 Build/Test Tools: Pass the `TRAVIS_BRANCH` and `TRAVIS_PULL_REQUEST` environment variables along to the Docker container.
This ensures that `WP_UnitTestCase::skipOnAutomatedBranches()` has access to these variables.

See #49050, #47767.

git-svn-id: https://develop.svn.wordpress.org/trunk@46999 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-20 00:01:33 +00:00
Sergey Biryukov 26cc3cfd19 Tests: Skip external HTTP test for recommended PHP and MySQL versions on 503 errors.
Fixes #49049.

git-svn-id: https://develop.svn.wordpress.org/trunk@46998 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-19 20:27:16 +00:00
Jake Spurlock 2fad299387 Editor: Add unit tests for v5.3.1 block serialization functions
r46896 was intended to have included unit tests for the block serialization functions added as part of the changeset.

Props: @aduth.
Fixes: #49048 



git-svn-id: https://develop.svn.wordpress.org/trunk@46997 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-19 18:48:49 +00:00
Sergey Biryukov 9fe4689f2d Tests: In `test_readme()`, if the HTTP request to `secure.php.net` or `dev.mysql.com` failed, include response code in the error message.
See #40533, #44613.

git-svn-id: https://develop.svn.wordpress.org/trunk@46996 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-19 15:43:33 +00:00
Sergey Biryukov 7cdb642610 Tests: Remove unused cache keys from `data_get_site_caches()`.
Follow-up to [46990].

See #40363.

git-svn-id: https://develop.svn.wordpress.org/trunk@46991 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-18 03:20:59 +00:00