Commit Graph

48982 Commits

Author SHA1 Message Date
Greg Ziółkowski
acad00ecab Editor: Add wakeup magic method to the block bindings registry
See #60282.
Follow-up [57373].
Props dmsnell, mukesh27, gziolo.



git-svn-id: https://develop.svn.wordpress.org/trunk@57575 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-09 10:52:09 +00:00
Greg Ziółkowski
ac11d1bbe4 Editor: Refactor block binding processing and attribute computation
Refactors the processing of block bindings into steps:
- Gets the value for each "bound" attribute from the respective source.
- Returns the computer attributes with values from the sources.
- The computed attributes get injected into block's content.
- The `render_callback` gets the updated list of attributes and processeded block content.

Fixes #60282.
Props czapla, gziolo, andraganescu, santosguillamot.



git-svn-id: https://develop.svn.wordpress.org/trunk@57574 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-09 10:38:38 +00:00
Isabel Brison
5c596f30d7 Themes: update add_theme_support docblock.
Adds missing features to the list for the `$feature` parameter in `add_theme_support()`.

Props up1512001, mukesh27, swissspidy, isabel_brison.
Fixes #60221.



git-svn-id: https://develop.svn.wordpress.org/trunk@57573 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-09 04:15:08 +00:00
Joe Dolson
533bbd14bd Users: Replace table tags for color palettes in profiles.
Replace the `table` element used to present color palette selection in the user profile screen with generic elements. The extra semantics of a table are at best unhelpful and have some potential to great extraneous verbosity for screen readers.

Props sabernhardt, desrosj.
Fixes #53157.

git-svn-id: https://develop.svn.wordpress.org/trunk@57572 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-08 23:29:18 +00:00
Aaron Jorbin
334555fa42 I18N: Add Translator comments for Planet URLs.
Props oglekler, zodiac1978, audrasjb, jorbin.
Fixes #58010.



git-svn-id: https://develop.svn.wordpress.org/trunk@57571 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-08 20:34:32 +00:00
Jonathan Desrosiers
4498eefb00 Build/Test Tools: Generate a human-readable HTML coverage report.
This updates the test coverage GitHub Actions workflow to generate a human-readable HTML report in addition to the current machine readable one submitted to Codecov.

Props jorbin.
Fixes #60476.

git-svn-id: https://develop.svn.wordpress.org/trunk@57570 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-08 19:30:26 +00:00
Sergey Biryukov
9e7f013d4e Twenty Twenty-Two: Prefix the pages block pattern category name.
If a plugin also registers the category name `pages` in an `init` hook that runs after the theme's, it can override the label and description unintentionally.

With a prefix, extenders can still override it, but it would be intentional.

Props poena, swissspidy, shailu25.
Fixes #59839.

git-svn-id: https://develop.svn.wordpress.org/trunk@57569 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-08 19:30:15 +00:00
Jonathan Desrosiers
b4819647f2 Build/Test Tools: Fix bug pulling local environment containers on Apple silicone.
The MySQL Docker containers for versions 5.7 and below do not support recent Apple silicone chips. Previously this was fixed by including `amd64/` as a prefix to the image name in the `docker-compose.yml` file (see [54096]). However, this stopped working after recent updates to Docker Desktop.

This changeset removes the `amd64/` prefix for the image used as the database container and raises the default version of MySQL in the local development environment to the current LTS version (8.0). Because this version is still maintained, there are `arm64` containers available to use.

This also documents a new workaround for contributors looking to run the local Docker environment using MySQL 5.7 or earlier, which entails creating a small `docker-compose.override.yml`.

Props bernhard-reiter, johnbillion, afragen, huzaifaalmesbah.
Fixes #59930.

git-svn-id: https://develop.svn.wordpress.org/trunk@57568 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-08 19:10:10 +00:00
Tonya Mork
9e753cb908 Coding Standards: Replace alias join() in WP_Font_Utils.
Replaces the alias `join()` with its canonical `implode()`.

Using the canonical function name for PHP functions is strongly recommended, as aliases may be deprecated or removed without (much) warning.

Follow-up to [57539], [49193].

Props davidbinda.
Fixes #60473.

git-svn-id: https://develop.svn.wordpress.org/trunk@57567 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-08 16:00:50 +00:00
Jonathan Desrosiers
f8b9b2abd7 Build/Test Tools: Unpin PHP 7.4 from the test coverage workflow.
Since being introduced, the GitHub Actions workflow responsible for generating and submitting a test coverage report has used PHP 7.4. At the time, there were some issues with running the test suite on PHP 8.0+ which could have resulted in inaccurate reporting.

The test suite and WordPress in general are much more stable on 8.x now. The test coverage report should now be generated using the Docker container tagged `latest` (currently 8.2).

This will result in a very small decrease in the percentage of lines covered by test (-0.05%), but a slight increase in the percentage of functions and methods covered (+0.08%).

Props johnbillion.
See #59647.

git-svn-id: https://develop.svn.wordpress.org/trunk@57566 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-08 15:35:54 +00:00
Greg Ziółkowski
e42bf01555 Editor: Add viewScriptModule handling to block.json metadata
Syncing changes from the Gutenberg plugin: https://github.com/WordPress/gutenberg/pull/57437.

Scripts and styles can be registered for blocks via `block.json` metadata. There is now a Modules API, but was no way to register or associate module assets with blocks via `block.json`.

Fixes #60233.
Props jonsurrell, gziolo, cbravobernal, luisherranz, youknowriad.



git-svn-id: https://develop.svn.wordpress.org/trunk@57565 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-08 10:39:24 +00:00
Greg Ziółkowski
1d8d810ea2 Interactivity API: Remove empty file
Missed that when applying patch from GitHub.

Follow-up [57563].
See #60356.
Props: swissspidy.



git-svn-id: https://develop.svn.wordpress.org/trunk@57564 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-08 09:24:10 +00:00
Greg Ziółkowski
6917cac581 Interactivity API: Integrate Server Directive Processing
The Interactivity API enables WordPress developers to create dynamic and interactive web experiences with ease using a set of special HTML attributes called directives. Please refer to the [Interactivity API proposal](https://make.wordpress.org/core/2023/03/30/proposal-the-interactivity-api-a-better-developer-experience-in-building-interactive-blocks/) for further details. 

It syncs the changes from the Gutenberg plugin: https://github.com/WordPress/gutenberg/pull/58066.

Fixes #60356.
Props luisherranz, jonsurrell, swissspidy, westonruter, gziolo.



git-svn-id: https://develop.svn.wordpress.org/trunk@57563 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-08 09:11:43 +00:00
Greg Ziółkowski
f03a263277 Editor: Introduce WP_Block_Bindings_Source class
Abstracts the block bindings source array into a well-defined object.

Fixes #60447.
See #60282.
Follow-up [57373].
Props czapla, santosguillamot, gziolo.



git-svn-id: https://develop.svn.wordpress.org/trunk@57562 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-08 08:55:18 +00:00
Greg Ziółkowski
fd8c730d6f Editor: Avoid double escaping on value passed for attribute in HTML tag processor
Fix for the Block Bindings processing.
See https://github.com/WordPress/wordpress-develop/pull/5888#discussion_r1476793062.

Props: czapla, dmsnell, gziolo.



git-svn-id: https://develop.svn.wordpress.org/trunk@57561 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-08 08:40:37 +00:00
Greg Ziółkowski
ae3ec6995a Editor: Improve code documentation for block bindings
Follow-up [57514].
See #60282.
Props czapla, gziolo, retrofox.



git-svn-id: https://develop.svn.wordpress.org/trunk@57560 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-08 08:35:47 +00:00
Greg Ziółkowski
0ff0842fee Editor: Make asset file optional for block scripts
It is no longer a hard requirement that a *.asset.php file is present to register a script for block. 

Fixes #57234.
Props joefusco, gziolo, spacedmonkey, colorful-tones. 



git-svn-id: https://develop.svn.wordpress.org/trunk@57559 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-08 08:16:59 +00:00
Riad Benguella
b3d834c132 Editor: Register the Google Font collection.
By default, users will see a tab in the editor indicating the possibility
to active Google Fonts and install Fonts from there.

Props youknowriad, get_dave, mcsf.
Fixes #59166.

git-svn-id: https://develop.svn.wordpress.org/trunk@57558 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-08 07:36:36 +00:00
Riad Benguella
435155f22a Script Loader: Improve translators comments for wp.date.setSettings in compat file.
Fixing a few translators comments that have incorrect placeholders reference or unnecessary ones.

Props get_dave, mukesh27, afercia.
Fixes #60412.

git-svn-id: https://develop.svn.wordpress.org/trunk@57557 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-08 07:09:50 +00:00
youknowriad
9da53b8b49 Script Loader: Add a timezone offset display value to wp.date.setSettings.
Fixes a bug in the editor where the offset values are displayed as decimals rather than minutes.

Props afercia, get_dave.
Fixes #60105.

git-svn-id: https://develop.svn.wordpress.org/trunk@57556 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-08 07:06:02 +00:00
Sergey Biryukov
50af5dbed1 Twenty Twenty-Four: Prefix the block pattern category name.
If a plugin also registers the category name `page` in an `init` hook that runs after the theme's, it can override the label and description unintentionally.

With a prefix, extenders can still override it, but it would be intentional.

Props shailu25, poena, acosmin, harshgajipara, swissspidy.
See #59839.

git-svn-id: https://develop.svn.wordpress.org/trunk@57555 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-07 19:43:09 +00:00
Joe Dolson
b88ad1b1b3 Bundled Theme: Improve focus outline in Twenty Twenty-Four.
Set a global focus outline for block elements in Twenty Twenty-Four to enhance accessibility. Replace the 1px dotted outline previously assigned on the button block.

Props alh0319, poena, beafialho, shailu25.
Fixes #60334.

git-svn-id: https://develop.svn.wordpress.org/trunk@57554 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-07 17:25:33 +00:00
Joe Dolson
bd534ccaa2 Administration: Improve contrast and consistency of focus styles.
Apply new focus styles from WordPress 5.3 more broadly. An updated focus style for form inputs, buttons, and link styled as buttons was added in WordPress 5.3; this commit makes other focus styles consistent with those changes so they meet accessibility standards for color contrast.

Props johnbillion, kebbet, joedolson, afercia.
Fixes #51870.

git-svn-id: https://develop.svn.wordpress.org/trunk@57553 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-07 16:54:58 +00:00
Jonathan Desrosiers
86f8a3c1ce Build/Test Tools: Revert [57551].
Problematic changes to the test reporter were merged upstream. This specific SHA also did not fix the issue.

Props javiercasares.
See #59647.

git-svn-id: https://develop.svn.wordpress.org/trunk@57552 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-07 13:55:50 +00:00
Jonathan Desrosiers
e285ac84b8 Build/Test Tools: Pin a specific commit for Hosting Test Reporter.
An upstream change in the Hosting Test Reporter is causing failures in the PHPUnit workflow. This temporarily pins an older hash to the step that checks the reporter out.

Props youknowriad.
See #59647.

git-svn-id: https://develop.svn.wordpress.org/trunk@57551 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-07 11:29:55 +00:00
Riad Benguella
5e345d4140 Editor: Update PHPDoc for block bindings's context arg.
The context argument passed to the hooked_block_types filter can also be a Post object
in the case of the navigation block.
This adapts the PHPDoc accordingly.

Props bernhard-reiter, gziolo.
See #59743.

git-svn-id: https://develop.svn.wordpress.org/trunk@57550 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-07 10:54:34 +00:00
Riad Benguella
f4861bad61 Editor: Fix typo in FontUtils doc block.
Initially introduced in [57539]

Props kebbet.
See #59166.

git-svn-id: https://develop.svn.wordpress.org/trunk@57549 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-07 10:34:24 +00:00
Riad Benguella
a770c6da8d REST API: Introduce the necessary endpoints for the font library.
This commits add three endpoints to retrieve and manipulate fonts in WordPress.
This commit also means that we now have a fully functional Font Library in the site editor.

Props get_dave, youknowriad, mmaattiiaass, grantmkin, swissspidy, mcsf, jorbin, ocean90.
See #59166.

git-svn-id: https://develop.svn.wordpress.org/trunk@57548 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-07 09:18:38 +00:00
Riad Benguella
952004a2b3 Editor: Fix block style variation selector generation.
These changes fix the generation of selectors for block style variations. Previously, an incorrect CSS selector could be generated if the block's base selector used an element tag etc.

Props aaronrobertshaw, youknowriad, mukesh27.
Fixes #60453.

git-svn-id: https://develop.svn.wordpress.org/trunk@57547 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-07 08:51:39 +00:00
Isabel Brison
27087b71e0 Script Loader: always output core block global styles after base global styles.
Changes the output of core block global styles when `should_load_separate_core_block_assets` is true so they are appended to base global styles instead of block-library styles.

Props isabel_brison, oandregal, azaozz, ajlende.
Fixes #60280.


git-svn-id: https://develop.svn.wordpress.org/trunk@57546 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-07 04:35:34 +00:00
Colin Stewart
2b08a77f5c Upgrade/Install: Introduce Plugin Dependencies.
Introduces a new "Requires Plugins" plugin header so that plugin developers can list the slugs of the plugins theirs depends on.

This will inform users of the requirements, and provide links to the WordPress.org Plugins Repository that they can click to install and activate the dependencies first.

Plugins whose requirements are not met cannot be installed or activated, and they will be deactivated automatically if their requirements become unmet.
Plugins that others rely on cannot be deactivated or deleted until their dependent plugins are deactivated or deleted.

In memory of Alex Mills and Alex King.
WordPress Remembers.

Props ahoereth, afragen, alanfuller, alexkingorg, amykamala, anonymized_10690803, apeatling, ashfame, atimmer, audrasjb, aristath, azaozz, batmoo, beaulebens, blobaugh, bobbingwide, boonebgorges, brianhenryie, chanthaboune, chrisdavidmiles, coolmann, costdev, courane01, danielbachhuber, davidperez, dd32, Denis-de-Bernardy, dingo_d, DJPaul, dougal, DrewAPicture, ethitter, filosofo, georgestephanis, giuseppemazzapica-1, goldenapples, griffinjt, hellofromTonya, husobj, ideag, jarednova, jbobich, jbrinley, jltallon, joedolson, johnciacia, johnjamesjacoby, joppuyo, jsmoriss, karmatosed, kebbet, knutsp, kraftbj, kraftner, kurtpayne, lkraav, logikal16, luisherranz, man4toman, markjaquith, matt, mbijon, megphillips91, mikeschinkel, mordauk, morehawes, mrwweb, mte90, mukesh27, mzaweb, nacin, norcross, nvwd, nwjames, obliviousharmony, ocean90, oglekler, paaljoachim, pauldewouters, pbaylies, pbiron, peterwilsoncc, Philipp15b, poena, pogidude, retlehs, rmccue, ryan, sabreuse, sc0ttkclark, scribu, sereedmedia, SergeyBiryukov, ShaneF, shidouhikari, soean, spacedmonkey, stephenh1988, swissspidy, taylorde, tazotodua, threadi, TimothyBlynJacobs, TJNowell, tollmanz, toscho, tropicalista, Viper007Bond, westi, whiteshadow, williamsba1, wpsmith, ZaneMatthew.
Fixes #22316.

git-svn-id: https://develop.svn.wordpress.org/trunk@57545 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-06 23:44:09 +00:00
Aaron Jorbin
3eb7bd1b29 Build/Test Tools: Make the props bot message shorter.
The new default is a git flavored version, while Core wants the SVN flavor. This update is required after https://github.com/WordPress/props-bot-action/pull/61

Props desrosj, jorbin, noisysocks, gziolo.
See #60417.


git-svn-id: https://develop.svn.wordpress.org/trunk@57544 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-06 21:11:27 +00:00
Riad Benguella
7a7133908f Editor: Show the patterns page for classic themes.
Block themes and classic themes with template parts support 
can already access the patterns list within the site editor.
This adds a "Patterns" menu item under Appearance for classic themes
without template parts support.

Props wildworks, kevin940726, aaronrobertshaw, fabiankaegy, swissspidy, get_dave, kebbet.
Fixes #58827.

git-svn-id: https://develop.svn.wordpress.org/trunk@57543 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-06 19:40:21 +00:00
Dennis Snell
b7027a85e0 HTML API: Join text nodes on invalid-tag-name boundaries.
A fix was introduced to the Tag Processor to ensure that contiguous text
in an HTML document emerges as a single text node spanning the full
sequence. Unfortunately, that patch was marginally over-zealous in
checking if a "<" started a syntax token or not. It used the following:

{{{
<?php
if ( 'A' <= $c && 'z' >= $c ) { ... }
}}}

This was based on the assumption that the A-Z and a-z letters are
contiguous in the ASCII range; they aren't, and there's a gap of
several characters in between. The result of this is that in some
cases the parser created a text boundary when it didn't need to.
Text boundaries can be surprising and can be created when reaching
invalid syntax, HTML comments, and more hidden elements, so
semantically this wasn't a major bug, but it was an aesthetic
challenge.

In this patch the check is properly compared for both upper- and
lower-case variants that could potentially form tag names.

{{{
<?php
if ( ( 'A' <= $c && 'Z' >= $c ) || ( 'a' <= $c && 'z' >= $c ) ) { ... }
}}}

This solves the problem and ensures that contiguous text appears
as a single text node when scanning tokens.

Developed in https://github.com/WordPress/wordpress-develop/pull/6041
Discussed in https://core.trac.wordpress.org/ticket/60385

Follow-up to [57489]
Props dmsnell, jonsurrell
Fixes #60385



git-svn-id: https://develop.svn.wordpress.org/trunk@57542 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-06 19:21:36 +00:00
Pascal Birchler
a0fedc97f5 Coding Standards: Fix array key alignment after [57539].
See #59166.

git-svn-id: https://develop.svn.wordpress.org/trunk@57541 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-06 10:56:38 +00:00
Riad Benguella
d928e5f916 Editor: Fix Font Library PHP unit tests.
These font assets files used in phpunit tests were missing in the original commit [57539].

Props mukesh27.
See #59166.

git-svn-id: https://develop.svn.wordpress.org/trunk@57540 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-06 09:22:39 +00:00
Riad Benguella
0cab832eef Editor: Introduce the Font Library post types and low level APIs.
This is the first step towards adding the font library to WordPress.
This commit includes the font library and font face CPTs.
It also adds the necessary APIs and classes to register and manipulate font collections.

This PR backports the font library post types and low level APIs to Core. This is the first step to include the font library entirely into Core. Once this merged, we'll open a PR with the necessary REST API controllers.

Props youknowriad, get_dave, grantmkin, swissspidy, hellofromtonya, mukesh27, mcsf.
See #59166.

git-svn-id: https://develop.svn.wordpress.org/trunk@57539 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-06 08:40:38 +00:00
Sergey Biryukov
5810f22747 Coding Standards: Rename the $oSelf variable in WP_MatchesMapRegex::apply().
This resolves a WPCS warning:
{{{
Variable "$oSelf" is not in valid snake_case format, try "$o_self"
}}}

Follow-up to [11853], [38376].

See #59650.

git-svn-id: https://develop.svn.wordpress.org/trunk@57538 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-06 01:23:54 +00:00
Peter Wilson
2ac96bcd07 Upload: Fallback to PclZip to validate ZIP file uploads.
`ZipArchive` can fail to validate ZIP files correctly and report valid files as invalid. This introduces a fallback to `PclZip` to check validity of files if `ZipArchive` fails them.

This introduces the new function `wp_zip_file_is_valid()` to validate archives.

Follow up to [57388].

Props audunmb, azaozz, britner, cdevroe, colorful-tones, costdev, courane01, endymion00, feastdesignco, halounsbury, jeffpaul, johnbillion, jorbin, jsandtro, karinclimber, kevincoleman, koesper, maartenbelmans, mathewemoore, melcarthus, mujuonly, nerdpressteam, olegfuture, otto42, peterwilsoncc, room34, sayful, schutzsmith, stephencronin, svitlana41319, swissspidy, tnolte, tobiasbg, vikram6, welaunchio.
Fixes #60398.


git-svn-id: https://develop.svn.wordpress.org/trunk@57537 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-05 22:21:35 +00:00
Jonathan Desrosiers
1950da3f17 Build/Test Tools: Pass a token to the Codecov action.
Version 4 of the action now requires a token to be provided in order to upload coverage results.

Follow up to [57534].

Props swissspidy.
See #59658.

git-svn-id: https://develop.svn.wordpress.org/trunk@57536 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-05 22:19:19 +00:00
Pascal Birchler
77aad3a72b General: Add tests for array_is_list polyfill added in r57337.
Props costdev.
See #55105.

git-svn-id: https://develop.svn.wordpress.org/trunk@57535 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-05 21:57:44 +00:00
Jonathan Desrosiers
4e633b50a1 Build/Test Tools: Update the codecov/codecov-action action.
This updates the `codecov/codecov-action` from version `3.1.5` to `4.0.1`.

Version 4 switches to using the Codecov CLI to upload test report date, and changes the version of Node.js used for the action to 20.x. This fixes the notices currently shown for the test coverage workflow.

Props: mukesh27.
See #59658.

git-svn-id: https://develop.svn.wordpress.org/trunk@57534 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-05 20:58:59 +00:00
Pascal Birchler
2ae28c50f9 Script Loader: Remove unused WP_Scripts::get_unaliased_deps() method.
This private method was introduced in [56033] / #12009 but it's not actually used.
It was part of the inline script implementation which was later reverted before final merge.
The method can be safely removed because it’s private and cannot be used by extenders.

Props joemcgill.
Fixes #60438.

git-svn-id: https://develop.svn.wordpress.org/trunk@57533 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-05 09:41:28 +00:00
Sergey Biryukov
8d47e64971 Coding Standards: Rename the $expires_offset variable in cache_javascript_headers().
This resolves a WPCS warning:
{{{
Variable "$expiresOffset" is not in valid snake_case format, try "$expires_offset"
}}}

Follow-up to [4109], [21996].

See #59650.

git-svn-id: https://develop.svn.wordpress.org/trunk@57532 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-05 03:40:25 +00:00
Peter Wilson
ac240f068d Build/Test Tools: Mock plugin API response in WP_REST_Plugins_Controller_Test.
Avoid false test failures due to network conditions in the `WP_REST_Plugins_Controller_Test` class. This mocks HTTP responses from the plugin information endpoint for the link-manager plugin.

Props: peterwilsoncc, costdev.
See #59647.



git-svn-id: https://develop.svn.wordpress.org/trunk@57531 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-04 22:02:02 +00:00
Sergey Biryukov
629d4c5753 Coding Standards: Rename the $ID parameter to $post_id in trackback().
This resolves a few WPCS warnings:
{{{
Variable "$ID" is not in valid snake_case format, try "$i_d"
}}}

See #59650.

git-svn-id: https://develop.svn.wordpress.org/trunk@57530 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-04 18:44:02 +00:00
Sergey Biryukov
7d9eb8fc95 Coding Standards: Use strict comparison in wp-admin/update-core.php.
Follow-up to [11273], [25784], [54654].

Props wpfy, mukesh27, azaozz, viralsampat.
Fixes #58061, #60415.

git-svn-id: https://develop.svn.wordpress.org/trunk@57529 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-03 14:22:44 +00:00
Dennis Snell
324f2d70b8 HTML API: Fix typo setting the wrong self-closing flag.
The HTML Processor tracks whether a token was found with the self-closing flag.
Depending on the context, this flag may or may not indicate that the element is
self closing. Unfortunately it's been tracking the wrong flag: it's been tracking
the end-tag flag, which indicates that a token is an end tag.

In this patch the right flag is set in the HTML Processor. This hasn't been an
issue because the HTML Processor doesn't yet read that stored flag, but it's an
important fix to make before adding support for foreign content (SVG and MathML)
since that behavior depends on reading the correct flag.

Follow-up to [56274].

Props dmsnell.



git-svn-id: https://develop.svn.wordpress.org/trunk@57528 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-02 23:25:56 +00:00
Dennis Snell
f80516dfab HTML API: Reset parser state after seeking to bookmark.
When parser states were introduced, nothing in the `seek()` method reset the
parser state. This is problematic because it could leave the parser in the
wrong state.

In this patch the parser state is reset so that it's properly adjusted on
the successive call to `next_token()`.

Developed in https://github.com/WordPress/wordpress-develop/pull/6021
Discussed in https://core.trac.wordpress.org/ticket/60428

Follow-up to [57211]

Props dmsnell, kevin940726
Fixes #60428



git-svn-id: https://develop.svn.wordpress.org/trunk@57527 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-02 22:55:27 +00:00
Greg Ziółkowski
235cb39891 Editor: Refactor the way block bindings sources are handled
It fixes the coding style issues reported. It goes further and improves the code quality it other places where the logic for block bindings was added.

Follow-up for [57514].
Props: gziolo, mukesh27, youknowriad, santosguillamot.
See #60282.



git-svn-id: https://develop.svn.wordpress.org/trunk@57526 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-02 20:22:11 +00:00