Commit Graph

39367 Commits

Author SHA1 Message Date
Andrea Fercia
c2fd19e12d Admin: Site Health JavaScript minor clean-up.
See #46573.


git-svn-id: https://develop.svn.wordpress.org/trunk@44988 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-23 16:38:48 +00:00
Sergey Biryukov
448ed1adfc Privacy: Update default privacy policy text to match the current behavior of setting a temporary cookie on visiting the login page.
Props mechter, subrataemfluence, garrett-eclipse.
Fixes #44175.

git-svn-id: https://develop.svn.wordpress.org/trunk@44987 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-23 10:53:20 +00:00
Gary Pendergast
dad6b61cfb Admin: Introduce the Site Health screens.
The Site Health tool serves two purposes:
- Provide site owners with information to improve the performance, reliability, and security of their site.
- Collect comprehensive debug information about the site.

By encouraging site owners to maintain their site and adhere to modern best practices, we ultimately improve the software hygeine of both the WordPress ecosystem, and the open internet as a whole.

Props Clorith, hedgefield, melchoyce, xkon, karmatosed, jordesign, earnjam, ianbelanger, wpscholar, desrosj, pedromendonca, peterbooker, jcastaneda, garyj, soean, pento, timothyblynjacobs, zodiac1978, dgroddick, garrett-eclipse, netweb, tobifjellner, pixolin, afercia, joedolson, birgire.
See #46573.


git-svn-id: https://develop.svn.wordpress.org/trunk@44986 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-23 03:54:16 +00:00
Adam Silverstein
7793e670b8 Multisite: add new sites_pre_query and networks_pre_query filters to short circuit WP_Site_Query and WP_Network_Query queries.
Similar to the `posts_pre_query` filter for WP_Query added in #36687. These filters lets you short circuit the queries to return your own results.

Add a new filter `sites_pre_query` - which returns null by default. Return a non-null value to bypass WordPress's default `get_sites` queries.

Developers should note that filtering functions that require pagination information are encouraged to set the `found_sites` property of the `WP_Site_Query` object, passed to the filter by reference. If `WP_Site_Query` does not perform a database query, it will not have enough information to generate these values itself.

Add a new filter `networks_pre_query` - which returns null by default. Return a non-null value to bypass WordPress's default `get_networks` queries.

Developers should note that filtering functions that require pagination information are encouraged to set the `found_networks` property of the `WP_Network_Query` object, passed to the filter by reference. If `WP_Network_Query` does not perform a database query, it will not have enough information to generate these values itself.

Props spacedmonkey.
Fixes #45749.



git-svn-id: https://develop.svn.wordpress.org/trunk@44983 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-22 17:25:38 +00:00
Aaron Jorbin
42547da41d PHP: Bump minimum version
95% of 5.6 sites are on 5.6.30 or higher, hence this specific minimum version.

Fixes #46594.




git-svn-id: https://develop.svn.wordpress.org/trunk@44982 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-22 15:46:56 +00:00
Sergey Biryukov
96922900c5 Plugins: Remove wp_is_wp_compatible() and wp_is_php_compatible() functions added in [44978] for now, to discuss use cases and better naming.
See #46599, #43992.

git-svn-id: https://develop.svn.wordpress.org/trunk@44981 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-22 12:59:02 +00:00
Sergey Biryukov
d69b5eb713 Plugins: Use <em> instead of <span> for PHP annotation in wp_plugin_update_row(), for consistency with other instances.
Props afragen.
Fixes #46598. See #43987.

git-svn-id: https://develop.svn.wordpress.org/trunk@44980 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-22 01:07:51 +00:00
Sergey Biryukov
0e1d2b42ef PHPCS: Fix WPCS violations in [44978].
See #43992.

git-svn-id: https://develop.svn.wordpress.org/trunk@44979 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-22 00:59:25 +00:00
Sergey Biryukov
1586c43c8d Plugins: Block plugin activation if it requires a higher version of PHP or WordPress.
Introduce `validate_plugin_requirements()` for validating a plugin's WordPress and PHP version requirements.

Introduce `wp_is_wp_compatible()` and `wp_is_php_compatible()` for checking compatibility with the current WordPress or PHP version.

Props afragen, joyously, DrewAPicture, TimothyBlynJacobs, desrosj, flixos90, SergeyBiryukov.
See #43992.

git-svn-id: https://develop.svn.wordpress.org/trunk@44978 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-22 00:36:30 +00:00
Jonathan Desrosiers
f170c1dd31 Networks and Sites: Introduce the ms_user_list_site_class filter.
In the network admin user table on multisite installs (`WP_MS_Users_List_Table`), this filter allows the classes for the `<span>` tag surrounding each site link to be modified.

Props kraftbj, flixos90, johnjamesjacoby.
Fixes #41146.

git-svn-id: https://develop.svn.wordpress.org/trunk@44977 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 23:54:05 +00:00
Sergey Biryukov
531d83a2f0 I18N: Move the strings for default user roles to wp-includes/capabilities.php, to make the translations available on the front end as well.
Props keraweb, ocean90.
Fixes #37539.

git-svn-id: https://develop.svn.wordpress.org/trunk@44976 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 22:23:00 +00:00
Sergey Biryukov
fa0190bcb1 Customize: Add a link to theme reviews in the theme details modal in the Customizer and on Add Themes screen.
Props celloexpressions, Travel_girl, Ixium, marco-peralta, dd32.
Fixes #36612.

git-svn-id: https://develop.svn.wordpress.org/trunk@44975 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 22:01:42 +00:00
Felix Arntz
4be7a863ff Bootstrap/Load: Fix WPCS violation in a new test following [44973].
See #46130.


git-svn-id: https://develop.svn.wordpress.org/trunk@44974 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 21:59:12 +00:00
Felix Arntz
1f3912e9bf Bootstrap/Load: Introduce a recovery mode for fixing fatal errors.
Using the new fatal handler introduced in [44962], an email is sent to the admin when a fatal error occurs. This email includes a secret link to enter recovery mode. When clicked, the link will be validated and on success a cookie will be placed on the client, enabling recovery mode for that user. This functionality is executed early before plugins and themes are loaded, in order to be unaffected by potential fatal errors these might be causing.

When in recovery mode, broken plugins and themes will be paused for that client, so that they are able to access the admin backend despite of these errors. They are notified about the broken extensions and the errors caused, and can then decide whether they would like to temporarily deactivate the extension or fix the problem and resume the extension.

A link in the admin bar allows the client to exit recovery mode.

Props timothyblynjacobs, afragen, flixos90, nerrad, miss_jwo, schlessera, spacedmonkey, swissspidy.
Fixes #46130, #44458.


git-svn-id: https://develop.svn.wordpress.org/trunk@44973 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 21:52:07 +00:00
Sergey Biryukov
57a38bed47 PHPCS: Remove extra tabs added in [44970].
See #44237.

git-svn-id: https://develop.svn.wordpress.org/trunk@44972 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 21:35:37 +00:00
Sergey Biryukov
864c3f07df Privacy: Use a consistent URL for Privacy Policy guide.
Props garrett-eclipse, mukesh27, birgire, desrosj.
Fixes #44876.

git-svn-id: https://develop.svn.wordpress.org/trunk@44971 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 21:16:52 +00:00
Sergey Biryukov
e987281597 Comments: Introduce comment_flood_message and comment_duplicate_message filters for comment flood and duplicate comment error messages.
Props odminstudios, Katyatina, mukesh27.
Fixes #44237.

git-svn-id: https://develop.svn.wordpress.org/trunk@44970 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 21:09:47 +00:00
Adam Silverstein
e1a070bb87 Media: introduce a "Heading" view for improved accessibility.
* Add a new media view: `wp.media.view.Heading` designed to add accessibility friendly headers in the media library/modal.
* Add an initial "Attachments list" heading above the attachments list.

Props afercia.
Fixes #36925.


git-svn-id: https://develop.svn.wordpress.org/trunk@44969 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 21:04:49 +00:00
Sergey Biryukov
393738de41 PHPCS: Remove extra spaces added in [44966].
See #44005.

git-svn-id: https://develop.svn.wordpress.org/trunk@44968 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 20:19:16 +00:00
Sergey Biryukov
c86ff5da2d Users: Introduce users_have_additional_content filter to indicate whether the users being deleted have additional content associated with them outside of the post_author and link_owner relationships.
Props garrett-eclipse, xkon, birgire.
Fixes #36860.

git-svn-id: https://develop.svn.wordpress.org/trunk@44967 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 20:11:29 +00:00
Sergey Biryukov
65bd3654cc Privacy: Introduce Privacy Policy page helpers:
* `is_privacy_policy()` template tag
* `privacy-policy.php` template
* `.privacy-policy` body class
* `.menu-item-privacy-policy` menu item class

Props garrett-eclipse, birgire, xkon, Clorith.
Fixes #44005.

git-svn-id: https://develop.svn.wordpress.org/trunk@44966 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 19:47:29 +00:00
K. Adam White
49d8c2590c REST API: Avoid undefined-property notice when setting parent term to 0.
Only try to access `term_id` once `$parent_term` is known to be a `WP_Term`.

Props dlh, earnjam.
Fixes #44983.


git-svn-id: https://develop.svn.wordpress.org/trunk@44965 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 18:58:50 +00:00
Andrea Fercia
9a129eec78 Upgrade/Install: Add missing opening curly bracket after [44513].
Props WebFactory.
Fixes #46563.


git-svn-id: https://develop.svn.wordpress.org/trunk@44964 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 18:02:53 +00:00
Sergey Biryukov
d3202c7a6f Post Formats: Remove CSS transition effect on post format icons in the Posts list table.
Props afercia, melchoyce.
See #46591, #35497.

git-svn-id: https://develop.svn.wordpress.org/trunk@44963 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 16:35:19 +00:00
Felix Arntz
b06444e859 Bootstrap/Load: Introduce fatal error handler.
This changeset introduces a `WP_Fatal_Error_Handler` class that detects fatal errors and displays a more user-friendly message about the site experiencing technical difficulties.

Websites that have custom requirements in that regard can implement their own fatal error handler by adding a `fatal-error-handler.php` drop-in that returns the handler instance to use, which must be based on a class that inherits `WP_Fatal_Error_Handler`. That handler will then be used in place of the default one. Alternatively, the fatal error handler feature can be completely disable through a constant `WP_DISABLE_FATAL_ERROR_HANDLER`.

Websites that would like to modify specifically the error template displayed in the frontend can add a `php-error.php` drop-in that works similarly to the existing `db-error.php` drop-in. For more granular customization, the fatal error handler also includes new filters `wp_should_handle_php_error`, `wp_php_error_message` and `wp_php_error_args`.

Props afragen, bradleyt, flixos90, ocean90, schlessera, SergeyBiryukov, spacedmonkey, timothyblynjacobs.
See #46130, #44458.


git-svn-id: https://develop.svn.wordpress.org/trunk@44962 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 16:02:05 +00:00
Sergey Biryukov
1d41c6e787 Accessibility: Remove post format filter links from format icons in the Posts list table.
Introduce a dedicated 'Formats' drop-down filter as a replacement.

Keep the icons as a simple visual indicator of the post format for now.

Props afercia, melchoyce, GaryJ, chiaralovelaces, SergeyBiryukov.
Fixes #35497.

git-svn-id: https://develop.svn.wordpress.org/trunk@44961 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 15:30:52 +00:00
Ella Van Durpe
5c2b9cca3f Block Editor: Update the WordPress Packages from Gutenberg 5.3
- @wordpress/a11y@2.2.0
 - @wordpress/annotations@1.2.0
 - @wordpress/api-fetch@3.1.0
 - @wordpress/autop@2.2.0
 - @wordpress/babel-plugin-import-jsx-pragma@2.1.0
 - @wordpress/babel-preset-default@4.1.0
 - @wordpress/blob@2.3.0
 - @wordpress/block-editor@1.1.0
 - @wordpress/block-library@2.4.0
 - @wordpress/block-serialization-default-parser@3.1.0
 - @wordpress/blocks@6.2.0
 - @wordpress/components@7.2.0
 - @wordpress/compose@3.2.0
 - @wordpress/core-data@2.2.0
 - @wordpress/data@4.4.0
 - @wordpress/date@3.2.0
 - @wordpress/deprecated@2.2.0
 - @wordpress/docgen@1.1.0
 - @wordpress/dom-ready@2.2.0
 - @wordpress/dom@2.2.0
 - @wordpress/e2e-test-utils@1.1.0
 - @wordpress/e2e-tests@1.1.0
 - @wordpress/edit-post@3.3.0
 - @wordpress/edit-widgets@0.2.0
 - @wordpress/editor@9.2.0
 - @wordpress/element@2.3.0
 - @wordpress/escape-html@1.2.0
 - @wordpress/eslint-plugin@2.1.0
 - @wordpress/format-library@1.4.0
 - @wordpress/hooks@2.2.0
 - @wordpress/html-entities@2.2.0
 - @wordpress/i18n@3.3.0
 - @wordpress/keycodes@2.2.0
 - @wordpress/list-reusable-blocks@1.3.0
 - @wordpress/notices@1.3.0
 - @wordpress/nux@3.2.0
 - @wordpress/plugins@2.2.0
 - @wordpress/priority-queue@1.1.0
 - @wordpress/redux-routine@3.2.0
 - @wordpress/rich-text@3.2.0
 - @wordpress/scripts@3.1.0
 - @wordpress/shortcode@2.2.0
 - @wordpress/url@2.5.0
 - @wordpress/viewport@2.3.0
 - @wordpress/wordcount@2.2.0



git-svn-id: https://develop.svn.wordpress.org/trunk@44960 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 12:46:11 +00:00
Jonathan Desrosiers
689ba4eec6 Posts, Post Types: Add type parameter to post_exists().
This allows post exists checks scoped to a specific post type.

Props sgarza, birgire, swissspidy.
Fixes #37406.

git-svn-id: https://develop.svn.wordpress.org/trunk@44959 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 12:43:48 +00:00
Sergey Biryukov
64681631f1 Menus: Use esc_url() for the href value of page link attributes in Walker_Page::start_el(), for consistency with Walker_Nav_Menu and Walker_Category.
See #40666, #40359.

git-svn-id: https://develop.svn.wordpress.org/trunk@44958 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 10:44:21 +00:00
Sergey Biryukov
ae0605b323 Accessibility: Introduce category_list_link_attributes filter in Walker_Category::start_el() for the HTML attributes applied to a category list item's anchor element.
This complements the `page_menu_link_attributes` filter in `Walker_Page::start_el()` and the `nav_menu_link_attributes` filter in `Walker_Nav_Menu::start_el()`.

Props pbiron, audrasjb, afercia.
Fixes #40666. See #40359.

git-svn-id: https://develop.svn.wordpress.org/trunk@44957 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 10:36:22 +00:00
Sergey Biryukov
fb93cedcd8 Accessibility: Add ability to pass an ARIA label for the <form> element returned by get_search_form().
This allows screen readers to properly announce each search landmark region independently.

Introduce `search_form_args` filter for the arguments used when generating the search form.

Props afercia, williampatton.
Fixes #42057.

git-svn-id: https://develop.svn.wordpress.org/trunk@44956 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 09:19:14 +00:00
Alex Shiels
722d0439f0 Coding Standards: exclude sodium_compat library.
Props dd32.
See #45806.


git-svn-id: https://develop.svn.wordpress.org/trunk@44955 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 05:55:05 +00:00
Alex Shiels
2976cfb7ca Upgrade/Install: Add experimental package signing to some updates.
This adds code for soft verification of signatures for theme and plugin installs and updates, when provided by the update server. This experimental version does not reject unverified packages or failed signatures; it simply reports anonymous errors so we can evaluate its feasibility and detect incompatibilities.

This code relies on the new sodium_compat library for PHP versions prior to 7.2.

Props dd32, paragoninitiativeenterprises.
See #39309, #45806.


git-svn-id: https://develop.svn.wordpress.org/trunk@44954 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 05:48:46 +00:00
Alex Shiels
53f45b4dfc General: Add sodium_compat library for crypto APIs in PHP < 7.2
This adds a pure PHP implementation of the cryptographic functions supported in PHP 7.2+. It provides the necessary backwards compatibility required to support signature verification and other security features going forward across all supported PHP versions.

Props paragoninitiativeenterprises
Fixes #45806. See #39309.


git-svn-id: https://develop.svn.wordpress.org/trunk@44953 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 04:55:21 +00:00
Jonathan Desrosiers
e3fb98daeb Menus: Ensure consistent padding in the menu structure form.
Props shital-patel, welcher, hardik-amipara, audrasjb.
Fixes #42596.

git-svn-id: https://develop.svn.wordpress.org/trunk@44952 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-21 02:55:44 +00:00
Adam Silverstein
e6ec0b2fe0 Build: correct some linting errors.
Fix linting failures after r44948 by running `composer run format`.


git-svn-id: https://develop.svn.wordpress.org/trunk@44951 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-20 22:05:58 +00:00
Aaron Jorbin
67b8f04db4 PHP: End official support for PHP5.2 -> 5.5
For the time being, we are ok with failures rather than not running the tests at all on these old versions. We will make decisions on fixes on a case by case basis.

Props chanthaboune.
See: https://make.wordpress.org/core/2018/12/08/updating-the-minimum-php-version/



git-svn-id: https://develop.svn.wordpress.org/trunk@44950 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-20 22:03:07 +00:00
Andrew Duthie
b71bd7a05f Scripts: Assign api-fetch nonce with corrected rest_nonce.
As of `@wordpress/api-fetch@3.0.0` (introduced in 44812), the `apiFetch` nonce middleware must have its nonce value assigned explicitly, and will no longer listen for heartbeat ticks automatically. This changeset adds an inline script for the default registration of the `api-fetch` script handle to assign the nonce value in response to the heartbeat action. In doing so, it removes the now-unused, misnamed `rest-nonce` property from the heartbeat response, whose original introduction served as temporary compatibility with earlier versions of `@wordpress/api-fetch`.

See https://github.com/WordPress/gutenberg/pull/13451
See #45113

Props adamsilverstein, nerrad .
Fixes #46107 .


git-svn-id: https://develop.svn.wordpress.org/trunk@44949 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-20 20:52:08 +00:00
adamsilverstein
d1de972555 Feeds: ensure build/update date matches current query.
Displaying the correct build date in feeds is as important today as it was twelve years ago when this ticket was opened.

Fix an issue where all feeds in WordPress showed the same date for their last build date (the datapoint is `lastBuildDate`, `updated` or `dc:date` depending on the feed type). 

Introduce a new `get_last_build_date` filter to adjust the date used for `lastBuildDate`. Developers who previously filtered `get_lastcommentmodified` to alter feed dates should use this filter instead.

* `get_last_build_date` extracts the latest post (or comment) in the current WP_Query object.
* In all feed templates, use `get_last_build_date` vs `get_lastpostmodified( 'GMT' );`.

Props stevenkword, spacedmonkey, ryanshoover, mauteri, nacin, jorbin, MikeNGarrett, Denis-de-Bernardy, peaceablewhale.
Fixes #4575.



git-svn-id: https://develop.svn.wordpress.org/trunk@44948 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-20 20:37:02 +00:00
Adam Silverstein
7d0d69af4a Media: grid view attachment filter drop down - only show available mime types.
In the media library gird view, properly limit the media attachment filter to available mime types, matching the list view.

Props itzmekhokan.
Fixes #43658.


git-svn-id: https://develop.svn.wordpress.org/trunk@44947 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-20 20:06:22 +00:00
Jonathan Desrosiers
0a875f0170 I18N: Remove admin notice when the WPLANG constant is no longer necessary.
Introduced in [29630], this admin notice informs administrators (or network administrators on multisite installs) that the `WPLANG` constant is no longer needed when the locale returned by `get_locale()` does not match. After 5 years, the notice is being removed to avoid causing confusion for non-technical users.

The `_deprecated_argument()` call will persist to inform developers of the issue within log files.

Props flixos90, iworks, ocean90.
Fixes #39675.

git-svn-id: https://develop.svn.wordpress.org/trunk@44946 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-20 18:57:21 +00:00
Jonathan Desrosiers
b748341bf3 Administration: Ensure consistent alignment for time and date fields across edit screens.
This change ensures that the values of time and date fields for comments and posts (both Classic Editor and quick edit) are consistently aligned in the center of the input fields. The block editor already enforces this alignment separately.

Props birgire, jainnidhi, melchoyce.
Fixes #43675.

git-svn-id: https://develop.svn.wordpress.org/trunk@44945 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-20 18:28:27 +00:00
John Blackbourn
4b2a7d4ab6 Build/Test tools: Add support for passing a WP_Error object to wp_die() during tests.
This brings the functionality inline with `wp_die()` during non-test usage.

Fixes #46460


git-svn-id: https://develop.svn.wordpress.org/trunk@44944 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-20 18:22:11 +00:00
Jonathan Desrosiers
34251aa2ab Tests: Fix failing tests for privacy export/erase requests when running the ajax group for multisite.
Props davidbinda, garrett-eclipse.
Fixes #43438.

git-svn-id: https://develop.svn.wordpress.org/trunk@44943 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-20 17:40:17 +00:00
Andrea Fercia
7834856fcb Accessibility: Ensure embed iframes have a title attribute.
Screen reader users rely on the iframe title attribute to describe the contents of iframes. A meaningful title attribute allows to quickly identify the iframe content, so users can determine which iframe to enter and explore in detail or skip if desired.
Note: this is the only case where a title attribute is required for compliance with the W3C Web Content Accessibility Guidelines (WCAG).

- checks for oEmbed response of type `video` or `rich`
- checks if they use an iframe
- fetches the title (if any) from the oEmbed response
- adds the title to the embed iframe

Props bamadesigner, TomHarrigan, swissspidy, jrf, afercia.
Fixes #40245.


git-svn-id: https://develop.svn.wordpress.org/trunk@44942 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-20 17:21:56 +00:00
Boone Gorges
30c21d2031 Posts: Avoid the use of globals in get_the_content() and related functions.
This changeset introduces `$post` parameters to `get_the_content()` and
`wp_trim_excerpt()`. When a `$post` object is passed to one of these functions,
the functions will operate on the data from that object, rather than from the
post globals (`$authordata`, `$page`, etc). This ensures that the functions work
in a predictable manner when used outside of the regular post loop.

The global-mismatch problem is surfaced in cases where `get_the_excerpt()` is
called outside of the post loop, on posts that don't have a defined excerpt. In
these cases, the post globals - used to generate a fallback excerpt - may refer
to the incorrect object, resulting in PHP notices or other unpredictable
behavior. See #36934 for a related issue.

Props spacedmonkey, kraftbj, Shital Patel.
Fixes #42814.

git-svn-id: https://develop.svn.wordpress.org/trunk@44941 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-20 15:48:46 +00:00
Jonathan Desrosiers
03f1f313a6 Administration: Update Dashicons to the latest version.
This change introduces the following new icons to the Dashicon font:

- `.dashicons-admin-site-alt (f11d)`
- `.dashicons-admin-site-alt2 (f11e)`
- `.dashicons-admin-site-alt3 (f11f)`
- `.dashicons-buddicons-activity (f452)`
- `.dashicons-buddicons-bbpress-logo (f12b)`
- `.dashicons-buddicons-buddypress-logo (f448)`
- `.dashicons-buddicons-community (f453)`
- `.dashicons-buddicons-forums (f449)`
- `.dashicons-buddicons-friends (f454)`
- `.dashicons-buddicons-groups (f456)`
- `.dashicons-buddicons-pm (f457)`
- `.dashicons-buddicons-replies (f451)`
- `.dashicons-buddicons-topics (f450)`
- `.dashicons-buddicons-tracking (f455)`
- `.dashicons-businessperson (f12e)`
- `.dashicons-businesswoman (f12f)`
- `.dashicons-color-picker (f131)`
- `.dashicons-editor-ltr (f129)`
- `.dashicons-editor-ol-rtl (f12c)`
- `.dashicons-email-alt2 (f10a)`
- `.dashicons-instagram (f12d)`
- `.dashicons-menu-alt (f10b)`
- `.dashicons-rest-api (f124)`
- `.dashicons-yes-alt (f12a)`
- `.dashicons-tide (f10d)`

These icons were added to the `.ttf, ` and `.eot` font files, as well as the SVG sprite. However, they were not added to the `.woff` font file. The new `dashicons.woff2` file should be utilized instead.

For instances where IE<11 needs to be supported, the `.woff` file will remain for backwards compatibility. However, if the new icons are needed in those scenarios, the WOFF format is now included as embedded within the `dashicons.css`.

Props EmpireOfLight, liljimmi, jaymanpandya, netweb, melchoyce, joen, folletto, nateallen, bahia0019, JeffPaul, desrosj, cathibosco1.
Fixes #41074. 

git-svn-id: https://develop.svn.wordpress.org/trunk@44940 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-20 15:42:09 +00:00
Jonathan Desrosiers
a6b129132d Plugins: Block plugin updates on the update screen if required PHP version is not supported.
This brings the changes in [44937] to the WordPress Updates page in the admin. Now, when a site does not meet the minimum PHP version requirements for a plugin update, the user will not be able to update. Instead, they will be presented with educational information to guide them through the process of updating PHP.

Props afragen, miyauchi, TimothyBlynJacobs, desrosj.
Fixes #44350. 

git-svn-id: https://develop.svn.wordpress.org/trunk@44939 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-20 14:58:03 +00:00
Dominik Schilling
17146f7192 Meta Boxes: Use a unique name for the nonce of the meta box loader.
Fixes a case where saving in the block editor fails if there are two `_wpnonce` arguments in the request, one overriding the other so that `use_block_editor_for_post()` wasn't able to check the nonce properly.

Props Chouby.
See #45253.

git-svn-id: https://develop.svn.wordpress.org/trunk@44938 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-20 08:11:05 +00:00
Jonathan Desrosiers
97bb59d939 Plugins: Block plugin updates if required PHP version is not supported.
When a plugin states it requires a specific minimum PHP version (as defined in the `requires_php` field included in the plugin update API response), a user should not be allowed to update that plugin when the server does not satisfy the minimum PHP version.

When this scenario is encountered, the update buttons and links are disabled and links to educational resources about PHP are displayed to the user with a notice.

Props afragen, schlessera, desrosj.
Fixes #43987. 

git-svn-id: https://develop.svn.wordpress.org/trunk@44937 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-20 01:43:05 +00:00