The delete button on the Edit Tag screen was misaligned after the form control updates in [61645]. Switch the action buttons row to a flexbox layout for stable alignment.
Follow-up to [61645].
Props mukesh27, tusharbharti, wildworks.
Fixes#65233.
Built from https://develop.svn.wordpress.org/trunk@62357
git-svn-id: http://core.svn.wordpress.org/trunk@61638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset disambiguates translation strings for "Preview" by adding a verb|noun context to its occurrences.
Props timse201, audrasjb, anupkankale, mohamedahamed, rafaeldella, motylanogha, wildworks, jorbin, khokansardar, sergeybiryukov.
Fixes#64986.
Built from https://develop.svn.wordpress.org/trunk@62353
git-svn-id: http://core.svn.wordpress.org/trunk@61634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The implementation issues a server-side HTTP request on every front-end page load and extracts the toolbar CSS via fragile substring matching. Alternatives are too large to land this late in the release cycle, so the fix is deferred to a future release.
Reverts [62025].
Props desrosj, jorbin, mukesh27, sabernhardt, wildworks.
See #64762.
Built from https://develop.svn.wordpress.org/trunk@62349
git-svn-id: http://core.svn.wordpress.org/trunk@61630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`to_ruleset` used string concatenation (`$element['name'] . ': ' . $element['value'] . ';'`), so PHP implicitly coerced non-string values (e.g. booleans → `'1'`/`''`, arrays → `'Array'`). That could emit invalid or misleading CSS.
At the same time, pass a `style` theme.json path in `test_get_styles_with_appearance_tools()` to simulate a style node. Before it was `settings`.
Props ramonopoly, andrewserong, isabel_brison.
Fixes#64848.
--This line, and those below, will be ignored--
M src/wp-includes/class-wp-theme-json.php
M tests/phpunit/tests/theme/wpThemeJson.php
Built from https://develop.svn.wordpress.org/trunk@62347
git-svn-id: http://core.svn.wordpress.org/trunk@61628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to make the test suite directory and file structure more intuitive for new contributors to work with, as well as follow the PHPUnit recommended test class name pattern with having `Test` as the end of the class name.
Follow-up to [61407], [62096], [62297], [62313], [62328].
See #65208.
Built from https://develop.svn.wordpress.org/trunk@62342
git-svn-id: http://core.svn.wordpress.org/trunk@61623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds an `isFileModDisabled` boolean — derived from `wp_is_file_mod_allowed( 'install_plugins' )` — to the data exposed via the `script_module_data_options-connectors-wp-admin` filter, so the connectors UI can adapt when file modifications are disabled.
Props jorgefilipecosta, westonruter, jeffpaul.
See #65209.
Built from https://develop.svn.wordpress.org/trunk@62341
git-svn-id: http://core.svn.wordpress.org/trunk@61622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Replace `file_exists()` with `validate_plugin()` in the connectors script module data, and refine PHPStan type definitions in the connectors code to better reflect the actual shape of registered connector data.
Follow-up to [62288].
Props jorgefilipecosta, mukesh27, peterwilsoncc, westonruter, wildworks.
See #65020.
Built from https://develop.svn.wordpress.org/trunk@62332
git-svn-id: http://core.svn.wordpress.org/trunk@61613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to make the test suite directory and file structure more intuitive for new contributors to work with, as well as follow the PHPUnit recommended test class name pattern with having `Test` as the end of the class name.
Follow-up to [34456].
Props poena.
See #53010.
Built from https://develop.svn.wordpress.org/trunk@62328
git-svn-id: http://core.svn.wordpress.org/trunk@61608 1a063a9b-81f0-0310-95a4-ce76da25c4cd
[61757] wrapped the media attachment filters, which changed the return value of toolbar filters from `AttachmentFilters` to a `wp.media.View` instance, breaking the API to customize media library filters.
Reverts the shape change in the attachment filter return value and implements CSS based positioning for the visible labels.
Props bernhard-reiter, joedolson, ozgursar, audrasjb, darshitrajyaguru97, jorbin.
Fixes#64948.
Built from https://develop.svn.wordpress.org/trunk@62326
git-svn-id: http://core.svn.wordpress.org/trunk@61606 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In [61458], a `postinstall` script was introduced that ensured the source code from the `gutenberg` repository was present before attempting to run the build script.
The WordPress.org Hosting Tests surfaced an edge case where the `postinstall` script was failing when `nodevenv` is used. Because it serves as a wrapper for Node.js, `NPM_CONFIG_PREFIX` is set to the virual envirnoment directory and not the actual project source directory.
This removes `gutenberg:verify` from `postinstall` entirely. `gutenberg:verify` is responsible for confirming that the `gutenberg` directory exists, that the commit SHA value in `gutenberg/.gutenberg-hash` matches `gutenberg.sha` in the `package.json` file, and it downloads a fresh copy if not.
While this will result in the necessary files not being present locally after running `npm install`, `gutenberg:verify` is specified as the first task executed when the `build` and `build:dev` scripts are run. Running either build script has been a requirement to run WordPress locally for some time now, so this does not introduce a new required step. It simply delays when the built asset will be retrieved from the GitHub Container Registry when necessary.
`postinstall` scripts should also be avoided entirely due to their significantly insecure nature (see #64543).
Follow up to [61492], [61873], and [62021].
Props jorbin, johnbillion.
Fixes#64874. See #64393, #64543.
Built from https://develop.svn.wordpress.org/trunk@62321
git-svn-id: http://core.svn.wordpress.org/trunk@61601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the JavaScript based regular expression to be case-insensitive, which matches the corresponding PHP pattern.
A defensive check has alos been added to avoid a `TypeError` if the admin bar is manipulated in a way that changes the path of the targeted element.
Follow up to [62282].
Props westonruter.
Fixes#65121.
Built from https://develop.svn.wordpress.org/trunk@62320
git-svn-id: http://core.svn.wordpress.org/trunk@61600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to make the test suite directory and file structure more intuitive for new contributors to work with, as well as follow the PHPUnit recommended test class name pattern with having `Test` as the end of the class name.
Follow-up to [434/tests], [57283].
See #53010.
Built from https://develop.svn.wordpress.org/trunk@62313
git-svn-id: http://core.svn.wordpress.org/trunk@61593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When an RTC session in the editor saves edits on a draft post, they always save into an autosave revision. This prevents a sync but where storing to the post itself would lead to duplicate edits. This was set in wordpress/gutenberg commit 9df142b839320316b406ee1a02e23704d42f8719. However, there is an exception to this rule: the first session to save edits needs to promote the autosave revision into a real draft post, if a post doesn’t exist. The reason is that WordPress hides autosaves.
That is, multiple people could be editing a draft post and then once they close it, never be able to find it again. While the data is still in the database, this is a loss of the post from a practical standpoint.
This change introduces an exception where the first time a collaborative session is saving draft edits, the autodraft is promoted to a real draft post, making it visible in the post list.
AI Disclaimer: This bug was detected in a fuzzing system built by AI models and the fix was first proposed by an AI model.
Developed in: https://github.com/WordPress/gutenberg/pull/77865
Discussed in: https://core.trac.wordpress.org/ticket/65138
See also: https://github.com/WordPress/gutenberg/pull/77716
Follow-up to [61680].
Props danluu, dmsnell.
See #65138.
Built from https://develop.svn.wordpress.org/trunk@62311
git-svn-id: http://core.svn.wordpress.org/trunk@61591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Akismet is bundled with WordPress core, but it wasn't appearing on the Connectors screen even when present on the file system.
Partially reverts [62210], bringing back the main part of [62193].
Follow-up to [62210], [62193].
Developed in https://github.com/WordPress/wordpress-develop/pull/11688.
Props audrasjb, bluefuton, davidbaumwald, desrosj, eclev91, gziolo, johnbillion, jorbin, jorgefilipecosta, lukecarbis, matt, matveb, peterwilsoncc, westonruter.
See #65012.
Built from https://develop.svn.wordpress.org/trunk@62310
git-svn-id: http://core.svn.wordpress.org/trunk@61590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Clarify the purpose of the `wp_register_custom_css_support` function. "Removing styles.css" is technically correct, but the comment didn't explain the "why" in plain language.
Props audrasjb, ramonopoly, peterwilsoncc.
Follow-up to [64771].
Built from https://develop.svn.wordpress.org/trunk@62299
git-svn-id: http://core.svn.wordpress.org/trunk@61579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Prevent Real-Time Collaboration sessions from becoming out of sync when an offline editor returns to an online state. The change ensures that the updates are merged rather than discarded when each client is at a different cursor after reconnecting or experiencing slow network conditions.
Props alecgeatches, peterwilsoncc, maxschmeling, joefusco.
See #64622.
Built from https://develop.svn.wordpress.org/trunk@62298
git-svn-id: http://core.svn.wordpress.org/trunk@61578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to make the test suite directory and file structure more intuitive for new contributors to work with, as well as follow the PHPUnit recommended test class name pattern with having `Test` as the end of the class name.
Follow-up to [58396], [61407].
See #53010.
Built from https://develop.svn.wordpress.org/trunk@62297
git-svn-id: http://core.svn.wordpress.org/trunk@61577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This adds a PHPStan extension with a parser-node visitor that bridges WordPress core's `@global Type $varname` PHPDoc convention to PHPStan's variable type resolution, eliminating 3,784 spurious errors caused by globals resolving as `mixed` when on rule level 10 (out of 40,069 errors total, so a 9.4% reduction). This avoids the need to add `/** @var Type $varname */` annotations with each global variable.
Developed in https://github.com/WordPress/wordpress-develop/pull/11692
Props westonruter, apermo, szepeviktor.
See #64898.
Built from https://develop.svn.wordpress.org/trunk@62292
git-svn-id: http://core.svn.wordpress.org/trunk@61572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Update `_wp_register_default_connector_settings()` to register a connector's
default API key setting only when the connector's `plugin.is_active` callback
returns `true`.
Add tests covering the gate's branches: setting skipped when `is_active`
returns `false`, setting registered when it returns `true`.
Props jorgefilipecosta, gziolo, peterwilsoncc.
Fixes#65099.
Built from https://develop.svn.wordpress.org/trunk@62289
git-svn-id: http://core.svn.wordpress.org/trunk@61569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds an optional `is_active` callable to the `plugin` definition accepted by
`WP_Connector_Registry::register()`. The callback receives no arguments, must
return a boolean, and is used by the Connectors screen to decide whether a
connector's backing plugin is currently active. When omitted, it defaults to
`__return_true`; when provided but not callable, registration fails with a
`_doing_it_wrong()` notice.
Developed in: https://github.com/WordPress/wordpress-develop/pull/11565
Props iamadisingh, jorgefilipecosta, mukesh27, gziolo.
Fixes#65020.
Built from https://develop.svn.wordpress.org/trunk@62288
git-svn-id: http://core.svn.wordpress.org/trunk@61568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Introduces a JavaScript fallback for determining whether the command palette icon in the toolbar should display ⌘Kfor Apple devices.
This is to account for sites behind a CDN as it's common for the User-Agent header to be stripped from the request sent to the application server in order to increase cache hits on the edge.
Props peterwilsoncc, westonruter, mukesh27, ramonopoly.
Fixes#65121.
Built from https://develop.svn.wordpress.org/trunk@62282
git-svn-id: http://core.svn.wordpress.org/trunk@61562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add automatic translation loading for script modules (ES modules), so strings using `__()` and friends from `@wordpress/i18n` can be translated at runtime. This brings classic script i18n parity to script modules registered via `wp_register_script_module()`, which previously had no way to load translation data, leaving strings untranslated on screens like Connectors and Fonts that are built as script modules.
At the `admin_print_footer_scripts` and `wp_footer` actions, every enqueued script module and its dependencies are walked, the translation chunk is loaded for each, and an inline `<script>` calls `wp.i18n.setLocaleData()` so translations are available before deferred modules execute. Note there is currently a runtime dependency on the `wp-i18n` classic script, which is printed just-in-time if not already enqueued. This coupling is to be removed in a future release.
Public API:
* `WP_Script_Modules::set_translations()` stores the text domain (and optional path) per registered module to override the text domain and path. A global `wp_set_script_module_translations()` function is added as a wrapper around `wp_script_modules()->set_translations()`.
* `WP_Script_Modules::get_registered()` obtains a registered module's data. See #60597.
* `WP_Script_Modules::print_script_module_translations()` emits inline `wp.i18n.setLocaleData()` calls after classic scripts load but before modules execute.
* `load_script_module_textdomain()` loads the translation data for a given script module ID and text domain.
* The existing `load_script_textdomain_relative_path` filter gains a third `$is_module` parameter so callers can distinguish classic-script and script-module lookups when resolving translation paths.
PHPStan types are also added in `WP_Script_Modules`. See #64238.
Developed in https://github.com/WordPress/wordpress-develop/pull/11543
Props manzoorwanijk, westonruter, jsnajdr, jonsurrell, mukesh27, peterwilsoncc, 369work, desrosj, sabernhardt, nilambar, jorgefilipecosta, malayladu.
See #64238, #60597.
Fixes#65015.
Built from https://develop.svn.wordpress.org/trunk@62278
git-svn-id: http://core.svn.wordpress.org/trunk@61558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In [62262], the show/hide button next to the password field was aligned using `line-height` and `vertical-align`. This approach
left the icon misaligned on mobile viewports.
Follow-up to [62262].
Props mukesh27, wildworks.
Fixes#65031.
Built from https://develop.svn.wordpress.org/trunk@62272
git-svn-id: http://core.svn.wordpress.org/trunk@61552 1a063a9b-81f0-0310-95a4-ce76da25c4cd