Allows fallback previews (PDF by default, in core) to save image meta
after each size is generated to allow for resuming, and make sizes
immediately available.
Props azaozz, antpb, progremzion, mikeschroder.
See #48111.
git-svn-id: https://develop.svn.wordpress.org/trunk@46459 602fd350-edb4-49c9-b593-d223f7449a82
Slashing non-string data caused PUT requests containing unmodified meta arrays of integers to fail the check against the existing stored meta value, causing a 500 when posting an unmodified response body back to the server.
Props TimothyBlynJacobs, augustuswm.
Fixes#48264.
git-svn-id: https://develop.svn.wordpress.org/trunk@46454 602fd350-edb4-49c9-b593-d223f7449a82
Ensures that the ::get_rest_controller() method will always return an instanceof the expected controller class, or null.
Removes unused private static property $post_type_controllers.
Props dlh, TimothyBlynJacobs.
Fixes#45677.
git-svn-id: https://develop.svn.wordpress.org/trunk@46435 602fd350-edb4-49c9-b593-d223f7449a82
Removes a special-case prohibition against embedding 'self' which prevented ?_embed from being used with the /wp/v2/search endpoint.
Props TimothyBlynJacobs, chrisvanpatten, kadamwhite.
Fixes#47684.
git-svn-id: https://develop.svn.wordpress.org/trunk@46434 602fd350-edb4-49c9-b593-d223f7449a82
The `_publish_post_hook()` function checks for `WP_IMPORTING` before setting meta fields fir enclosures and pings, which means this test is doomed to fail.
The test can be re-implemented if the `WP_IMPORTING` constant gets moved to a function similar to how `wp_installing()` works for the `WP_INSTALLING` constant.
See #48014
git-svn-id: https://develop.svn.wordpress.org/trunk@46428 602fd350-edb4-49c9-b593-d223f7449a82
1. `POST /wp/v2/media`.
2. If the upload failed (HTTP 500 error), look for a response header with `X-WP-Upload-Attachment-ID` header that contains the newly created attachment ID.
3. `POST /wp/v2/media/{id}/post-process` with `{ "action": "create-image-subsizes" }`. This request may still fail, but it will save its progress.
4. On continued failure, `DELETE /wp/v2/media/{id}` to give up on the upload and instruct the user to resize their image before uploading.
Props TimothyBlynJacobs.
Fixes#47987.
git-svn-id: https://develop.svn.wordpress.org/trunk@46422 602fd350-edb4-49c9-b593-d223f7449a82
This prevents standalone percent symbols from being stripped out, e.g. in a default value like `100%`.
Props aristath, kuus, moonomo, westonruter, davetgreen, daviedR, katielgc, noisysocks, SergeyBiryukov.
Fixes#34290.
git-svn-id: https://develop.svn.wordpress.org/trunk@46395 602fd350-edb4-49c9-b593-d223f7449a82
Headings are the predominant mechanism for screen reader users to find information in a page. They also help all users to better identify the main sections of user interfaces.
- adds three new headings within the media modal
- improves plural form translation for "item selected" by using `wp.i18n`
- horizontally centers the media modal menu in the responsive view
Props kjellr, karmatosed, melchoyce, afercia.
See #47149.
Fixes#47610.
git-svn-id: https://develop.svn.wordpress.org/trunk@46375 602fd350-edb4-49c9-b593-d223f7449a82
Added missing @ticket for #47863 on `data_shortcode_parse_atts()`
Also cleans up some linter fixes that were missed.
Props garrett-eclipse, whyisjake.
ixes #47863.
git-svn-id: https://develop.svn.wordpress.org/trunk@46370 602fd350-edb4-49c9-b593-d223f7449a82
Ensure consistency between `shortcode_parse_attts()` when being used directly.
Props mauteri, birgire, SergeyBiryukov, kadamwhite, whyisjake.
Fixes#47863.
git-svn-id: https://develop.svn.wordpress.org/trunk@46369 602fd350-edb4-49c9-b593-d223f7449a82
If there is no global comment, or the input comment is null, return early to prevent warnings.
Fixes#41846
Props birgire, earnjam
git-svn-id: https://develop.svn.wordpress.org/trunk@46335 602fd350-edb4-49c9-b593-d223f7449a82
This function must not be modified to return anything due to existing themes which output the return value, for example via `echo get_template_part( ... )`.
See #40969
git-svn-id: https://develop.svn.wordpress.org/trunk@46328 602fd350-edb4-49c9-b593-d223f7449a82
In [46312] and [46313] we attempted to do some phpcs cleanup. This commit cleans up three issues that were introduced in [46309].
Fixes#48142.
Props: whyisjake, garrett-eclipse, desrosj
git-svn-id: https://develop.svn.wordpress.org/trunk@46314 602fd350-edb4-49c9-b593-d223f7449a82
`phpcbf` was able to clean up a few files. Tests were breaking as a result of code formatting.
Fixes#48142
Props whyisjake
git-svn-id: https://develop.svn.wordpress.org/trunk@46312 602fd350-edb4-49c9-b593-d223f7449a82
The current logic in TwentyFifteen (#30366) for making the sidebar sticky while still allowing to scroll through it when the sidebar height is larger than the viewport height is flawed and massively overcomplicated.
This can be mitigated by removing the admin bar specific logic and leaving most of the heavy lifting up to the browser.
Fixes#37536
Props DvanKooten, lukecavanagh, karmatosed, ianbelanger, davidbaumwald
git-svn-id: https://develop.svn.wordpress.org/trunk@46308 602fd350-edb4-49c9-b593-d223f7449a82
Completes work begun in #39953 to expose "date floating" status information to frontend clients via the REST API.
Props TimothyBlynJacobs.
Fixes#48113.
git-svn-id: https://develop.svn.wordpress.org/trunk@46279 602fd350-edb4-49c9-b593-d223f7449a82
After being imported in [46271], Twenty Twenty can now be set as the default theme in WordPress.
See #48110.
Props desrosj, ocean90.
git-svn-id: https://develop.svn.wordpress.org/trunk@46278 602fd350-edb4-49c9-b593-d223f7449a82
Cache REST controller references on their associated post type object to prevent unnecessary controller re-instantiation, which previously caused "rest_prepare_{$post_type}" and "rest_{$post_type}_query" to run twice per request.
Props TimothyBlynJacobs, patrelentlesstechnologycom.
Fixes#45677.
git-svn-id: https://develop.svn.wordpress.org/trunk@46272 602fd350-edb4-49c9-b593-d223f7449a82
Pass email data to the `wp_privacy_personal_data_email_content` filter.
Props garrett-eclipse, thakkarhardik, birgire.
Fixes#46303.
git-svn-id: https://develop.svn.wordpress.org/trunk@46265 602fd350-edb4-49c9-b593-d223f7449a82
Expose a date_floating property on all status objects to permit clients (including the block editor) to make correct decisions about date handling for posts of varying status.
Props mnelson4, earnjam, kadamwhite, jnylen0, nerrad, pento.
See #39953.
git-svn-id: https://develop.svn.wordpress.org/trunk@46252 602fd350-edb4-49c9-b593-d223f7449a82
This commit brings the Network-Admin Sites list page up-to-speed with other similar list-table powered pages, by adding links to filter the results by Site Status.
Includes a single unit test for the newly introduced `wp_count_sites()` multisite function, named to match the `wp_count_` function pattern from other list tables.
Fixes#37392. Props mnelson4, spacedmonkey, pbiron.
git-svn-id: https://develop.svn.wordpress.org/trunk@46251 602fd350-edb4-49c9-b593-d223f7449a82
Adds support for `flex`, `grid` and `column` layout techniques to the list of CSS attributes considered safe for inline CSS. The `\` character and CSS functions, eg `minmax()` are not yet supported.
Extends support of `border` properties to include `border-radius` and individual `background` properties to include all those implicitly supported by the shorthand attribute.
Props mrahmadawais, marybaum, birgire, peterwilsoncc, azaozz.
Fixes#37248.
See #47367.
git-svn-id: https://develop.svn.wordpress.org/trunk@46235 602fd350-edb4-49c9-b593-d223f7449a82
The `str_getcsv()` function was introduced in PHP 5.3.0, so no longer needs a polyfill.
Props jrf.
Fixes#48074.
git-svn-id: https://develop.svn.wordpress.org/trunk@46222 602fd350-edb4-49c9-b593-d223f7449a82
The `get_called_class()` function was introduced in PHP 5.3, so no longer needs a workaround.
Mark `WP_UnitTestCase_Base::get_called_class()` as deprecated. Leave it in place for now as plugins or themes using the WP unit test framework might still call this method.
Props jrf.
See #48074.
git-svn-id: https://develop.svn.wordpress.org/trunk@46221 602fd350-edb4-49c9-b593-d223f7449a82
The PHP native JSON extension has been bundled and compiled with PHP by default since version 5.2.0. Because the minimum version of PHP required by WordPress is now 5.6.20 (see #46594 and [45058]), JSON extension related polyfills and backwards compatibility code can now be removed.
This change removes code that supported JSON related functionality on older versions of PHP. This includes (but is not limited to) checks that `json_last_error()` exists, checking and setting the `JSON_UNESCAPED_SLASHES` and `JSON_PRETTY_PRINT` constants if not previously defined, and deprecating the `_wp_json_prepare_data()` function (which was 100% workaround code).
Follow up of [46205].
See #47699.
Props jrf, Clorith, pento.
git-svn-id: https://develop.svn.wordpress.org/trunk@46206 602fd350-edb4-49c9-b593-d223f7449a82
The PHP native JSON extension has been bundled and compiled with PHP by default since version 5.2.0. Because the minimum version of PHP required by WordPress is now 5.6.20 (see #46594 and [45058]), JSON extension related polyfills and backwards compatibility code can now be removed.
Since there are still some plugins and themes that utilize the `Services_JSON` class, these classes will remain for the time being, but including the `wp-includes/class-json.php` file and creating `Services_JSON` instances will now throw deprecated notices.
See #47699.
Props jrf, Clorith, pento.
git-svn-id: https://develop.svn.wordpress.org/trunk@46205 602fd350-edb4-49c9-b593-d223f7449a82
Add a position argument to the `add_submenu_page` function similar to the one already in `add_menu_page`. When adding sub menus enables setting the position in the sub menu where the item should appear.
In addition, add the position argument to functions that call `add_submenu_page` under the hood: `add_management_page`, `add_options_page`, `add_theme_page`, `add_plugins_page`, `add_users_page`, `add_dashboard_page`, `add_posts_page`, `add_media_page`, `add_links_page`, `add_pages_page` and `add_comments_page`.
Props welcher, birgire, alexvorn2.
Fixes#39776.
git-svn-id: https://develop.svn.wordpress.org/trunk@46197 602fd350-edb4-49c9-b593-d223f7449a82
`compare_key`, introduced in #42409, previously supported only `=` and `LIKE`
operators. This changeset introduces a number of other operators: `!=`, `IN`,
`NOT IN`, `NOT LIKE`, `RLIKE`, `REGEXP`, `NOT REGEXP`, `EXISTS`, and `NOT EXISTS`
(the latter two aliased to `=` and `!=`, respectively). To support case-sensitive
regular expression key comparisons, the new `type_key` parameter will force
a MySQL `CAST` when 'BINARY' is passed.
Props soulseekah.
Fixes#43346.
git-svn-id: https://develop.svn.wordpress.org/trunk@46188 602fd350-edb4-49c9-b593-d223f7449a82
The purpose of meta registration is to assert that the meta key will contain a predictable value conforming to a schema, so the schema is therefore considered to be required.
Props TimothyBlynJacobs, grapplerulrich.
Fixes#43392.
git-svn-id: https://develop.svn.wordpress.org/trunk@46186 602fd350-edb4-49c9-b593-d223f7449a82
Enable clients to opt-in to receipt of one or more specific sub-properties within a response, and not other sub-properties.
Skip potentially expensive filtering and processing for post resources which were explicitly not requested.
Props kadamwhite, TimothyBlynJacobs, dlh.
Fixes#42094.
git-svn-id: https://develop.svn.wordpress.org/trunk@46184 602fd350-edb4-49c9-b593-d223f7449a82
The `implode()` function accepts two parameters, `$glue` and `$pieces`. For historical reasons, these parameters have been accepted in any order, though it was recommended that the documented order of `$glue, $pieces` be used. It is also generally considered best practice to use the canonical function rather than an alias.
Starting in PHP 7.4, specifying the parameters in the reverse order will trigger a deprecation notice with the plan to remove this tolerance in PHP 8.0.
Props jrf.
Fixes#36824. See #47746.
git-svn-id: https://develop.svn.wordpress.org/trunk@46182 602fd350-edb4-49c9-b593-d223f7449a82
Removing the direct SQL query in `do_all_pings()` improves filterability.
As part of this change, the signature of `do_enclose()` is changed so that
a null `$content` parameter can be passed, with the `$content` then inferred
from the `$post` passed in the second parameter. In addition, the second
parameter was modified so that a post ID or a `WP_Post` object can be
provided. These changes make it possible to trigger enclosure checks with
a post ID alone (as in `do_all_pings()`) and also brings the function
signature in line with `do_trackbacks()` and `pingback()`.
Props dshanske, spacedmonkey, janw.oostendorp, mrmadhat, birgire.
See #36824.
git-svn-id: https://develop.svn.wordpress.org/trunk@46175 602fd350-edb4-49c9-b593-d223f7449a82
This commit expands the list of allowed protocols. It adds the `sms://` which can be used to open meessaging clients for mobile users.
Props rilwis, kraftbj
Fixes#39415
git-svn-id: https://develop.svn.wordpress.org/trunk@46172 602fd350-edb4-49c9-b593-d223f7449a82
Continuation of [46167]. This fixes the tests that ended up broken following the previous commit.
We've extracted wp-includes/wp-a11y.js to a reusable package wordpress/a11y which is published on NPM. Let's make sure this package is also
used in WordPress core. Once all the JavaScript is built using webpack, we can also import this package wherever it is used and configure
webpack to load is an external.
Props, garrett-eclipse
Fixes#45066
git-svn-id: https://develop.svn.wordpress.org/trunk@46169 602fd350-edb4-49c9-b593-d223f7449a82
We've extracted wp-includes/wp-a11y.js to a reusable package wordpress/a11y which is published on NPM. Let's make sure this package is also used in WordPress core. Once all the JavaScript is built using webpack, we can also import this package wherever it is used and configure webpack to load is an external.
Props omarreiss, herregroen, desrosj, ocean90, afercia, sstoqnov
git-svn-id: https://develop.svn.wordpress.org/trunk@46167 602fd350-edb4-49c9-b593-d223f7449a82
When a theme declares HTML5 support for script and styles via `add_theme_support( 'html5', array( 'script', 'style' ) )`, the `type="text/javascript"` and `type="text/css"` attributes are omitted.
These attributes are unnecessary in HTML5 and cause warnings in the W3C Markup Validation Service.
Props sasiddiqui, swissspidy, knutsp, SergeyBiryukov.
See #42804.
git-svn-id: https://develop.svn.wordpress.org/trunk@46164 602fd350-edb4-49c9-b593-d223f7449a82
The `add_post_type_support()` function accepts an optional third parameter that allows extra arguments to be supplied to configure post type support for a given feature. However, because of how `register_post_type()` and `WP_Post_Type->add_supports()` work, it is currently impossible to pass these additional arguments when initially registering a post type with `register_post_type()`.
This change makes it possible to supply additional arguments for a feature using the `supports` argument of `register_post_type()`.
Props MaximeCulea, seuser, desrosj, johnbillion.
Fixes#40413.
git-svn-id: https://develop.svn.wordpress.org/trunk@46160 602fd350-edb4-49c9-b593-d223f7449a82
Introduce `get_post_timestamp()` to retrieve post published or modified time as a Unix timestamp.
Use `get_post_datetime()` in `get_post_time()` and `get_post_modified_time()` to return correct GMT time if default timezone is changed from UTC.
Props Rarst, johnregan3.
Fixes#25002.
git-svn-id: https://develop.svn.wordpress.org/trunk@46154 602fd350-edb4-49c9-b593-d223f7449a82
Rather than relying `func_get_args()` to retrieve arbitrary function arguments, we can now use the spread operator to assign them directly to a variable.
Props jrf.
See #47678.
git-svn-id: https://develop.svn.wordpress.org/trunk@46127 602fd350-edb4-49c9-b593-d223f7449a82
When nav menu location slugs are integers, some hard to debug results can occur. `register_nav_menus()` utilizes `array_merge()` which renumbers numeric indexes, starting from 0. Because of this, numeric menu locations will almost always be changed.
This change introduces a `_doing_it_wrong()` notice to inform developers that nav menu locations should always be strings.
Props audrasjb, desrosj, welcher.
Fixes#45361.
git-svn-id: https://develop.svn.wordpress.org/trunk@46102 602fd350-edb4-49c9-b593-d223f7449a82
Improve the `pre_query` filters in multisite classes introduced in r44983. Return (non null) values immediately,
avoiding the database queries entirely, similar to other `pre_query` filters.
Props spacedmonkey, SergeyBiryukov, felipeelia.
Fixes#47599.
git-svn-id: https://develop.svn.wordpress.org/trunk@46100 602fd350-edb4-49c9-b593-d223f7449a82
Update `rest_ensure_request()` to accept a string path, permitting a string path to be passed to `rest_do_request()` as is indicated (previously inaccurately) in that method's PHPDoc.
Props TimothyBlynJacobs, kadamwhite.
Fixes#40614.
git-svn-id: https://develop.svn.wordpress.org/trunk@46099 602fd350-edb4-49c9-b593-d223f7449a82
The attribute is meant to communicate to user agents and assistive technologies that the element has a description. If the referenced description is missing, it will be flagged as failure by any automated accessibility checker tool and, most importantly, is potentially confusing for assistive technologies users.
Props afercia, joedolson, dinhtungdu, donmhico, SergeyBiryukov.
Fixes#47975.
git-svn-id: https://develop.svn.wordpress.org/trunk@46090 602fd350-edb4-49c9-b593-d223f7449a82
Hook documentation should be on the line directly above the line containing the `do_action()` or `apply_filters()` call. 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 duplicate hook references.
Includes minor code layout fixes.
See #47110.
git-svn-id: https://develop.svn.wordpress.org/trunk@46088 602fd350-edb4-49c9-b593-d223f7449a82
Introduces the `wp_image_resize_identical_dimensions` filter so plugins and themes can determine whether a new image with identical dimensions should be created, defaults to false.
Props wpdennis, HKandulla, galbaras, azaozz.
See #32437.
git-svn-id: https://develop.svn.wordpress.org/trunk@46077 602fd350-edb4-49c9-b593-d223f7449a82
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
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
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
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