Add attributes to KSES so that it's possible to create popover interactions natively in the editor. Adds `popovertarget`, `popovertargetaction` and `aria-haspopup` to `button`; `popover` to `div`, `ul`, and adds `dialog` with the attributes `open`, `closedby`, and `popover`.
Props harshdeepgill, jonsurrell, joedolson, sukhendu2002, flixos90, joedolson.
Fixes#61959.
Built from https://develop.svn.wordpress.org/trunk@60884
git-svn-id: http://core.svn.wordpress.org/trunk@60220 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The edit access in now taken into account for each individual post, term, or user in the response.
Props andraganescu, desrosj, ehti, hurayraiit, iandunn, joehoyle, johnbillion, jorbin, mnelson4, noisysocks, peterwilsoncc, rmccue, timothyblynjacobs, vortfu, whyisjake, zieladam.
Built from https://develop.svn.wordpress.org/trunk@60814
git-svn-id: http://core.svn.wordpress.org/trunk@60150 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Instead of requiring the client side to keep a separate list of block attributes that are supported by Block Bindings, communicate that list from the server -- including block attributes that were added there via the `block_bindings_supported_attributes` filter.
Props bernhard-reiter, mukesh27, gziolo.
Fixes#64030.
Built from https://develop.svn.wordpress.org/trunk@60807
git-svn-id: http://core.svn.wordpress.org/trunk@60143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
For all CSS generated icons across core, either add `aria-hidden="true"` to the HTML wrapper or set the generated content alternative to an empty string in the CSS using the alternative text specification for CSS generated content.
Props afercia, joedolson, cheffheid, jhabdas.
Fixes#40428.
Built from https://develop.svn.wordpress.org/trunk@60806
git-svn-id: http://core.svn.wordpress.org/trunk@60142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In cases where a string is used both for a visible label and a screen reader text label, the screen reader text should never be different from the visible label. To help ensure this doesn't happen, use only a single string. The associated screen reader text comments are no longer required.
This is also true for a few cases where there are strings in contexts where variables can't be used. In these cases, the screen reader text comments are also removed.
Props sabernhardt, swissspidy, audrasjb, joedolson.
Fixes#63620.
Built from https://develop.svn.wordpress.org/trunk@60805
git-svn-id: http://core.svn.wordpress.org/trunk@60141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This enables developers to directly invoke the Composer instance of the `wordpressdevelop/php` container from their host machine, making it easier to call Composer-specific scripts: linting, formatting, etc.
Props paulbonneau, SirLouen.
Fixes#63912.
Built from https://develop.svn.wordpress.org/trunk@60803
git-svn-id: http://core.svn.wordpress.org/trunk@60139 1a063a9b-81f0-0310-95a4-ce76da25c4cd
PHP 8.5 deprecates the `__sleep()` and `__wakeup()` magic methods in favor of `__serialize()` and `__unserialize()`:
> `Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary)`
For PHP < 7.4 compatibility, `__sleep()` and `__wakeup()` need to be kept for the time being.
This commit moves the logic of `__wakeup()` methods in core to `__unserialize()`, and turns the former into wrappers. WordPress core does not use `__sleep()` methods, so these are the only changes required.
Reference: [https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_sleep_and_wakeup_magic_methods PHP RFC: Deprecations for PHP 8.5: Deprecate the __sleep() and __wakeup() magic methods].
Follow-up to [56835], [60787], [60795].
Props TobiasBg, tusharbharti, swissspidy, dmsnell, SergeyBiryukov.
Fixes#63962. See #63061.
Built from https://develop.svn.wordpress.org/trunk@60796
git-svn-id: http://core.svn.wordpress.org/trunk@60132 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is the fourth in a series of patches to modernize and standardize UTF-8 handling.
`wp_check_invalid_utf8()` has long been dependent on the runtime configuration of the system running it. This has led to hard-to-diagnose issues with text containing invalid UTF-8. The function has also had an apparent defect since its inception: when requesting to strip invalid bytes it returns an empty string.
This patch updates the function to remove all dependency on the system running it. It defers to the `mbstring` extension if that’s available, falling back to the new UTF-8 scanning pipeline.
To support this work, `wp_scrub_utf8()` is created with a proper fallback so that the remaining logic inside of `wp_check_invalid_utf8()` can be minimized. The defect in this function has been fixed, but instead of stripping the invalid bytes it will replace them with the Unicode replacement character for stronger security guarantees.
Developed in https://github.com/WordPress/wordpress-develop/pull/9498
Discussed in https://core.trac.wordpress.org/ticket/63837
Follow-up to: [60768].
Props askapache, chriscct7, Cyrille37, desrosj, dmsnell, helen, jonsurrell, kitchin, miqrogroove, pbearne, shailu25.
Fixes#63837, #29717.
See #63863.
Built from https://develop.svn.wordpress.org/trunk@60793
git-svn-id: http://core.svn.wordpress.org/trunk@60129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add a block-agnostic version of the `block_bindings_supported_attributes_{$block_type}` filter first introduced in [60611].
This allows adding block bindings support for attributes of multiple different blocks in one go.
Follow-up to [60611].
Props bernhard-reiter.
See #62090.
Built from https://develop.svn.wordpress.org/trunk@60790
git-svn-id: http://core.svn.wordpress.org/trunk@60126 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to avoid extra changes to database structure when type case is the only difference:
{{{
Changed type of wp_table.field from varchar(255) to VARCHAR(255)
}}}
Follow-up to [1575], [37532].
Props leewillis77, tristanleboss, lordspace, johnbillion, SergeyBiryukov.
Fixes#59481.
Built from https://develop.svn.wordpress.org/trunk@60789
git-svn-id: http://core.svn.wordpress.org/trunk@60125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add the `aria-haspopup` attribute and `aria-controls` on the Add Media button in the classic editor, so that screen reader users are notified about the behavior of the button.
Props alh0319, rishabhwp, joedolson.
Fixes#63973.
Built from https://develop.svn.wordpress.org/trunk@60786
git-svn-id: http://core.svn.wordpress.org/trunk@60122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Rename the arguments in `comment_type()` to use underscore separators per coding standards and to add vowels for clarity.
"Pingback" and "Trackback" in the variable names are left unchanged as they are concatenated for display to site owners.
See #63168.
Built from https://develop.svn.wordpress.org/trunk@60779
git-svn-id: http://core.svn.wordpress.org/trunk@60115 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to bring more consistency with the rest of core, and more closely mirrors the similar changes upstream to use `sys_get_temp_dir()`.
The potential `false` return value was not checked by the only caller in `Text_Diff_Engine_shell::diff()`.
Follow-up to [7747], [48464], [49185], [60776].
Props TimoTijhof, apermo, SergeyBiryukov.
Fixes#63711.
Built from https://develop.svn.wordpress.org/trunk@60777
git-svn-id: http://core.svn.wordpress.org/trunk@60113 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is the third in a series of patches to modernize and standardize UTF-8 handling.
When the fallback UTF-8 validation code was added it was placed inside formatting.php; however, that validation logic can be reused for a number of related UTF-8 functions. To faciliate this it was moved into a new location and loaded early. This patch is follow-up to that first half, whereby the UTF-8 scanning logic forms its own new `_wp_scan_utf8()` function. This new UTF-8 scanner is a low-level function which forms a shared spec-compliant processing core to power multiple fallback functions and some new functionality as well.
Developed in https://github.com/WordPress/wordpress-develop/pull/9830
Discussed in https://core.trac.wordpress.org/ticket/63863
Follow-up to: [60743].
See #63863.
Built from https://develop.svn.wordpress.org/trunk@60768
git-svn-id: http://core.svn.wordpress.org/trunk@60104 1a063a9b-81f0-0310-95a4-ce76da25c4cd