[pull] trunk from WordPress:trunk - #1982
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
3af2d27 to
64ede28
Compare
git-svn-id: https://develop.svn.wordpress.org/trunk@62759 602fd350-edb4-49c9-b593-d223f7449a82
git-svn-id: https://develop.svn.wordpress.org/trunk@62760 602fd350-edb4-49c9-b593-d223f7449a82
…False()`. Replace boolean assertions wrapping other checks with the dedicated PHPUnit assertions: * `assertContains()`/`assertNotContains()` instead of `in_array()` or `array_search()` wrapped in `assertTrue()`/`assertFalse()`. * `assertDirectoryExists()` instead of `assertTrue( is_dir( ... ) )`. This clarifies intent and produces more descriptive failure messages. Props Soean, mukesh27, SergeyBiryukov. See #64894. git-svn-id: https://develop.svn.wordpress.org/trunk@62761 602fd350-edb4-49c9-b593-d223f7449a82
This commit guards `validate_custom_css()` against non-string input, returning a `rest_custom_css_invalid_type` `WP_Error` with a 400 status instead of a fatal. Before, `styles.css` had no type constraint in the global styles request schema, so a REST consumer could PUT an array (or any non-string value). That value reached `strlen()` in `validate_custom_css()` and threw an uncaught `TypeError` on PHP 8+. Developed in: [https://github.com/WordPress/wordpress-develop/pull/12549](https://github.com/WordPress/wordpress-develop/pull/12549) Props andrewserong, ramonopoly. Fixes #65640. git-svn-id: https://develop.svn.wordpress.org/trunk@62762 602fd350-edb4-49c9-b593-d223f7449a82
…nager`. This addresses 3 PHPStan errors: > Unreachable statement - code above always terminates. Each line of code is unreachable because the preceding statement exits execution. Developed in #12497. Follow-up to r62704. Props soean, mukesh27. See #64898. git-svn-id: https://develop.svn.wordpress.org/trunk@62763 602fd350-edb4-49c9-b593-d223f7449a82
Removes code in `user-profile.js` that was originally meant to set initial focus to the password field in the reset password screen. The call to setting focus leaked on other pages, for example the Add User page, where setting initial focus to a field in the middle of the form is not desirable. The removed code was redundant anyways, as the reset password screen already comes with an inline script that takes care of initial focus. Developed in #12534 Props iamchitti, afercia. Fixes #65630. git-svn-id: https://develop.svn.wordpress.org/trunk@62764 602fd350-edb4-49c9-b593-d223f7449a82
Returning values from `__construct()` and `__destruct()` is a deprecated practice starting with PHP 8.6, as per [https://wiki.php.net/rfc/deprecate-return-value-from-construct a recent RFC]. Props iamchitti, Soean. Fixes #65637. git-svn-id: https://develop.svn.wordpress.org/trunk@62765 602fd350-edb4-49c9-b593-d223f7449a82
This avoids a fatal out-of-memory error when running `composer run lint` checks. Props Soean. Fixes #65649. git-svn-id: https://develop.svn.wordpress.org/trunk@62766 602fd350-edb4-49c9-b593-d223f7449a82
Register the wp-theme stylesheet in the script loader so design tokens are available to wp-components and the block editor dependency chain. Developed in: #12560 Reviewed by aduth, ciampo, mukesh27. Fixes #65646. git-svn-id: https://develop.svn.wordpress.org/trunk@62767 602fd350-edb4-49c9-b593-d223f7449a82
…rameter. The case meant to test the optional `$length` parameter passed it as an argument to `assertSame()` instead of `url_shorten()`. So the latter ran with its default length of 35, the expected value happened to match the default output, and the assertion passed — while the `$length` parameter was never actually tested. This commit: * Converts the tests to a data provider with descriptive keys, so a failure points to the exact case. * Separates the default-behavior cases from the custom-length cases. * Adds real coverage for `$length`: the URL is kept when the length exceeds or equals the cleaned URL (pinning the strict `>` comparison) and shortened when it is smaller. * Adds a comment clarifying that a shortened URL is cut to `( $length - 3 )` characters before `…` is appended. No production code is changed — this is a test-only improvement. Developed in #12558. Follow-up to [35314]. Props Soean, mukesh27, SergeyBiryukov. See #64894. git-svn-id: https://develop.svn.wordpress.org/trunk@62768 602fd350-edb4-49c9-b593-d223f7449a82
Props xknown, johnbillion, joehoyle, jorbin, sergeybiryukov, ehtis, desrosj. git-svn-id: https://develop.svn.wordpress.org/trunk@62769 602fd350-edb4-49c9-b593-d223f7449a82
Props xknown, sergeybiryukov, joehoyle, jorbin, clorith, johnbillion, desrosj. git-svn-id: https://develop.svn.wordpress.org/trunk@62770 602fd350-edb4-49c9-b593-d223f7449a82
Props peterwilsoncc, westonruter, xknown, joehoyle, sergeybiryukov, jorbin, johnbillion, desrosj. git-svn-id: https://develop.svn.wordpress.org/trunk@62771 602fd350-edb4-49c9-b593-d223f7449a82
The files being added to `$_old_files` in this change were previously removed in [62334] and [62337]. However, they remained in the core.svn.wordpress.org repository due to a bug on the build server. That has been fixed and the files have been removed as expected, so they must be added to the list of old files. Props johnbillion, jorbin, desrosj, sergeybiryukov. Fixes #65325. git-svn-id: https://develop.svn.wordpress.org/trunk@62777 602fd350-edb4-49c9-b593-d223f7449a82
This adds one more file to the `$_old_files` list that should be included. Props barry, johnbillion, jorbin, desrosj. See #65325. git-svn-id: https://develop.svn.wordpress.org/trunk@62779 602fd350-edb4-49c9-b593-d223f7449a82
The contents of the `src/wp-includes/collaboration` directory were removed in [62337]. However, SVN requires the directory to also be deleted. Props barry, johnbillion, jorbin, desrosj, sergeybiryukov. See #65325, #65205. git-svn-id: https://develop.svn.wordpress.org/trunk@62781 602fd350-edb4-49c9-b593-d223f7449a82
Follow up to [62777]. Props johnbillion, jorbin, desrosj. See #65325, #65205. git-svn-id: https://develop.svn.wordpress.org/trunk@62782 602fd350-edb4-49c9-b593-d223f7449a82
Props johnbillion, jorbin, desrosj, barry. See #65325, #65205. git-svn-id: https://develop.svn.wordpress.org/trunk@62783 602fd350-edb4-49c9-b593-d223f7449a82
git-svn-id: https://develop.svn.wordpress.org/trunk@62784 602fd350-edb4-49c9-b593-d223f7449a82
git-svn-id: https://develop.svn.wordpress.org/trunk@62792 602fd350-edb4-49c9-b593-d223f7449a82
…tip.js`. The `files` in `tsconfig.json` are also re-sorted. Developed in #12546. Follow-up to r62741. Props westonruter, joedolson. See #51006. git-svn-id: https://develop.svn.wordpress.org/trunk@62794 602fd350-edb4-49c9-b593-d223f7449a82
…sts.
This resolves a warning in preparation for updating to WPCS 3.4.0:
{{{
Silencing errors is strongly discouraged. Use proper error checking instead.
}}}
Additionally, this brings consistency with a similar fragment in the pattern directory endpoint tests, which already used `wp_parse_url()`.
Follow-up to [48242], [51021].
See #64894.
git-svn-id: https://develop.svn.wordpress.org/trunk@62795 602fd350-edb4-49c9-b593-d223f7449a82
The impact on existing WordPress core code is expected to be minimal. The release updates some sniffs to account for changes in recent WordPress versions up to 7.0. References: * [https://github.com/WordPress/WordPress-Coding-Standards/releases/tag/3.4.0 WPCS 3.4.0 release notes] * [WordPress/WordPress-Coding-Standards@3.3.0...3.4.0 Full list of changes in WPCS 3.4.0] Follow-up to [56695], [56799], [57378], [57986], [60523], [61306]. Props jrf, dingo_d, garyj, rodrigosprimo, mattgaldino, pamprn, jasonkenison, jonmcpartland, rafaelfunchal, paulgibbs, tikifez, dd32, bhubbard, petitphp, paulopmt1, nicsevic, diegogarciarodrigues, Soean, SergeyBiryukov. Fixes #65659. git-svn-id: https://develop.svn.wordpress.org/trunk@62796 602fd350-edb4-49c9-b593-d223f7449a82
This adds precise `@param` and `@return` typing for the `wp_parse_list()`, `wp_parse_id_list()`, and `wp_parse_slug_list()` functions; native `array` return types are also added. It also adds casting and type guarding to guarantee the types of the values involved. Descriptions are updated to indicate that lists may not be returned, which may be unexpected given the function names; instead, sparse arrays or even associative arrays may be returned. Additionally, typically invalid ID values like zero may be in the array returned by `wp_parse_id_list()` and an empty string may be in the array returned by `wp_parse_slug_list()`. Tests are added to ensure existing behavior is preserved. This fixes 6 PHPStan errors at rule level 10. Developed in #12588. Follow-up to r38832, r44546, r57737, r62647, r62771. See #64898. git-svn-id: https://develop.svn.wordpress.org/trunk@62797 602fd350-edb4-49c9-b593-d223f7449a82
…mail(). Moves the `@param` annotation below `@global` per the documentation standards. Props peterwilsoncc, mukesh27. See #64896. git-svn-id: https://develop.svn.wordpress.org/trunk@63173 602fd350-edb4-49c9-b593-d223f7449a82
The Fonts and Connectors screens no longer render their own heading and JavaScript-required notice. The generated page template now provides both for every route-based screen, so the per-screen markup only produced a duplicate heading and notice when JavaScript was disabled. Developed in: #12946 Follow-up to [62954]. Props hbhalodia, wildworks. Fixes #65840. git-svn-id: https://develop.svn.wordpress.org/trunk@63174 602fd350-edb4-49c9-b593-d223f7449a82
The help text on the login screen stated that the option reduces how often you are asked to log in. It actually extends how long you stay logged in before being asked again, so the wording now describes that behavior. Follow-up to [62741]. Props joedolson, johnbillion, sabernhardt, wildworks. Fixes #55343. git-svn-id: https://develop.svn.wordpress.org/trunk@63175 602fd350-edb4-49c9-b593-d223f7449a82
…)` for key lookups. This updates several places in core that test whether an array has a given key: * `in_array( $key, array_keys( $array ), true )` allocates a complete copy of every key and walks it. * `isset( $array[ $key ] )`, on the other hand, does a single hash lookup in constant time with no allocation. Note: For arrays that main contain `null` values, [https://www.php.net/manual/en/function.array-key-exists.php#example-2 array_key_exists()] should be used instead. Developed in #12929. Props mukesh27, siliconforks. Fixes #65842. git-svn-id: https://develop.svn.wordpress.org/trunk@63177 602fd350-edb4-49c9-b593-d223f7449a82
Developed in #12957. Follow-up to [62715]. Props dmsnell, bernhard-reiter. See #65372. git-svn-id: https://develop.svn.wordpress.org/trunk@63178 602fd350-edb4-49c9-b593-d223f7449a82
Form feeds after closing tag names were not recognized, causing complete elements to appear incomplete. Developed in #12936. Props jonsurrell, westonruter. See #65372. git-svn-id: https://develop.svn.wordpress.org/trunk@63179 602fd350-edb4-49c9-b593-d223f7449a82
The presentation properties allowlisted in [62530] were accepted in name only: any declaration whose value contained a function call was dropped in full, so for users without the `unfiltered_html` capability those properties remained unusable in their canonical form. URL references are routed through the existing protocol validation, so the security model is unchanged. Developed in: #12942 Follow-up to [62530]. Props courane01, hasnainashfaq, irozum, khokansardar, mdridipu, tyxla. Fixes #65832. git-svn-id: https://develop.svn.wordpress.org/trunk@63180 602fd350-edb4-49c9-b593-d223f7449a82
The `@param` annotation for `$type` in `WP_Feed_Cache_Transient::__construct()` documented the type as `Base::TYPE_FEED|Base::TYPE_IMAGE`. The class is declared in the global namespace and imports nothing—it writes `implements SimplePie\Cache\Base` out in full—so the bare `Base` resolved to `\Base`, which exists nowhere in core. The shorthand was carried over in r59141 from `SimplePie\Cache\Base` itself, where it is correct because that file declares `namespace SimplePie\Cache;`. Qualifying both constants makes the annotation consistent with the rest of the docblock, which already spells the interface out in full. This was the only `parameter.unresolvableType` occurrence, so the change empties `tests/phpstan/baselines/parameter.unresolvableType.neon`. As the baseline header directs, the file is deleted along with its `includes` entry in `phpstan.neon.dist`. The baseline was regenerated with: {{{ composer phpstan:baselines -- --identifier=parameter.unresolvableType }}} Developed in #12970. Follow-up to r59141, r63020. Props callumbw95. See #65817. git-svn-id: https://develop.svn.wordpress.org/trunk@63181 602fd350-edb4-49c9-b593-d223f7449a82
Introducing the new content for the 7.1 About page. Props joedolson, mdridipu, benjamin_zekavica, wildworks, rcorrales, annezazu, webverts, alanjacobmathew, markoserb, sfougnier, mukesh27, umesh.nevase, ekamran, jorbin, masteradhoc, obenland, krupajnanda, adamsilverstein. Fixes #65698, #65346. svn rm src/wp-admin/images/ git-svn-id: https://develop.svn.wordpress.org/trunk@63182 602fd350-edb4-49c9-b593-d223f7449a82
This modifies the conditions for GitHub Actions workflow runs so that they do not run within private forks and mirrors for `pull_request` events when the PR is in `draft` status. For situations where this may be desirable, a `Draft Workflow Runs` label can be added to a `draft` pull request to force workflows to run. Props desrosj, jorbin. See #65848. git-svn-id: https://develop.svn.wordpress.org/trunk@63183 602fd350-edb4-49c9-b593-d223f7449a82
Removes an extra space in one of the About page translatable strings. Follow up to [63182]. Props joedolson, alanjacobmathew. See #65698. git-svn-id: https://develop.svn.wordpress.org/trunk@63184 602fd350-edb4-49c9-b593-d223f7449a82
The version description included a reference to a change that did not ship in version 7.1. Props joedolson, annezazu. See #65698. git-svn-id: https://develop.svn.wordpress.org/trunk@63185 602fd350-edb4-49c9-b593-d223f7449a82
Follow up to [63009]. Original commit removed a `:not(.mobile)` qualifier from the `:hover` rule, but not from the default state rule. Remove the default rule as well, so colors are handled consistently. Props fushar, khokansardar, madhavishah01, wildworks, afercia, joedolson. Fixes #65848. git-svn-id: https://develop.svn.wordpress.org/trunk@63188 602fd350-edb4-49c9-b593-d223f7449a82
Follow up to [63009]. The original commit strengthened the focus state in the admin toolbar, but didn't change the hover state. This created a mismatch in behavior where the admin toolbar behaved differently from the primary admin menu, which has a shared hover and focus state. Apply the focus state to the hover condition as well, so that the behavior matches the admin sidebar. Props fushar, wildworks, ravichudasama01, afercia, joedolson. Fixes #65849. git-svn-id: https://develop.svn.wordpress.org/trunk@63190 602fd350-edb4-49c9-b593-d223f7449a82
…amic in PHPStan. The `DB_COLLATE` and `WP_DEVELOPMENT_MODE` constants both vary per installation, but neither was listed in `dynamicConstantNames`, so PHPStan resolved each to the empty string it is handed during analysis. Every conditional guarding either constant was therefore reported as having a constant result, accounting for two `ternary.alwaysFalse` errors in `class-wp-debug-data.php` and one `booleanAnd.rightAlwaysFalse` error in `class-wpdb.php`. Listing both constants as dynamic resolves all three errors and empties their baselines, which are deleted along with their `includes` entries in `phpstan.neon.dist`. Developed in #12958. Follow-up to r61699, r63023. Props callumbw95. See #65817. git-svn-id: https://develop.svn.wordpress.org/trunk@63191 602fd350-edb4-49c9-b593-d223f7449a82
Fix an issue where the finalize endpoint stored the sub-size file names a client sent without confirming a sideloaded image had produced them for that attachment. Those names are later resolved against the attachment's upload directory and read or deleted, so finalize could record a file the upload never created. To address this, the sideload endpoint now records each name it generates under a `_wp_sideloaded_file` post meta key, and the finalize endpoint accepts a name only when: 1. a prior sideload recorded it in post meta, 2. it is the attachment's own attached file, or 3. it is already stored in the attachment's metadata. Anything else returns a `rest_invalid_sub_size_file` error (HTTP 400) before any metadata is written. Sideloads are also pinned to the attachment's own subdirectory via the `upload_dir` filter, so names are in the directory they later resolve against. Finalize stays safe to repeat: a name already in the attachment's metadata is accepted again. Follow-up to r61982, r62609. Reviewed by westonruter. Props westonruter. See #64804. git-svn-id: https://develop.svn.wordpress.org/trunk@63200 602fd350-edb4-49c9-b593-d223f7449a82
The trackback and pingback excerpt lines in the comment moderation notification email now document their placeholder for translators. Follow-up to [63030]. Props obenland, SergeyBiryukov, wildworks. See #64899. git-svn-id: https://develop.svn.wordpress.org/trunk@63204 602fd350-edb4-49c9-b593-d223f7449a82
… the same site. Includes: * Updating version annotations to 7.1.0. * Clarifying "this site" means "the same site" in various docs. * Prefixing the new filter with `wp_`. * Extending the tests: * Adds a test to ensure MS sub-site posts are not auto approved. * Adds a test to ensure that post ID sent to filter is zero for external sites. * Adds docs for each test. Developed in #12928. Follow-up to r63036. Props peterwilsoncc, jeremyfelt, youknowriad, wildworks, sabernhardt, SergeyBiryukov. See #65016. git-svn-id: https://develop.svn.wordpress.org/trunk@63207 602fd350-edb4-49c9-b593-d223f7449a82
Props ehtis, dmsnell, jeremyfelt, westonruter, SergeyBiryukov, aaroncampbell, jorbin, batmoo, johnbillion, lancewillett, tyxla, vortfu, xknown. git-svn-id: https://develop.svn.wordpress.org/trunk@63210 602fd350-edb4-49c9-b593-d223f7449a82
This bumps the version for the upcoming release WordPress 7.1. Twenty Ten: 4.7. Twenty Eleven: 5.2. Twenty Twelve: 4.9. Twenty Thirteen: 4.7. Twenty Fourteen: 4.6. Twenty Fifteen: 4.3. Twenty Sixteen: 3.9. Twenty Seventeen: 4.2. Twenty Nineteen: 3.4. Twenty Twenty: 3.2. Twenty Twenty-One: 2.9. Twenty Twenty-Two: 2.2. Twenty Twenty-Three: 1.7. Twenty Twenty-Four: 1.6. Twenty Twenty-Five: 1.5. Props khokansardar, mukesh27, rcorrales, sabernhardt, shailu25, wildworks. Fixes #65322. git-svn-id: https://develop.svn.wordpress.org/trunk@63211 602fd350-edb4-49c9-b593-d223f7449a82
Linting the About page styles with Stylelint reported a number of CSS coding standards violations, and this changeset addresses most of them. Discussed in: #13014 Follow-up to [63182]. Props afercia, mukesh27, wildworks. See #65856. git-svn-id: https://develop.svn.wordpress.org/trunk@63212 602fd350-edb4-49c9-b593-d223f7449a82
[63167] made several required post-branching changes to `trunk`, but also included the results of `grunt replace:workflow-references-local-to-remote` which is run as part of `grunt post-branching`. All reusable workflow files in `trunk` should be called using local references so that changes to these files are automatically tested within pull requests without having to push the changes to a fork and change the references. Props joedolson, wildworks. Fixes #65844. See #62416. git-svn-id: https://develop.svn.wordpress.org/trunk@63230 602fd350-edb4-49c9-b593-d223f7449a82
Converts the `WP_HTML_Processor::class_list()` and `WP_HTML_Tag_Processor::class_list()` examples to runnable WordPress Playground snippets. Corrects the encoded closing angle bracket so the expected output matches the parsed class name. Developed in #13034. Props jonsurrell. See #64896. git-svn-id: https://develop.svn.wordpress.org/trunk@63293 602fd350-edb4-49c9-b593-d223f7449a82
The `strip_baseline_includes()` function in `generate-baselines.php` dropped an `includes` entry only when it resolved inside the output directory. With the default output directory, that test covers the managed region exactly, so nothing appeared amiss. When `--output-dir` was used to point the output elsewhere, however, every baseline already in force stayed active for the analysis, which then reported only the errors those baselines did not already cover: a differential baseline where a complete one was requested. Strip the region between the `# phpstan:baselines` markers whatever it points at, since that region is generated and lists every baseline in force. The output directory test is kept as well, so a baseline listed by hand outside the markers is still suppressed when it is about to be rewritten. Found while generating a baseline from the 7.0.0 source tree to identify which errors have been introduced since: with the managed region left in place, PHPStan refused to start at all, as two of the entries named files which do not exist in 7.0.0. Follow-up to r63019. See #64680, #65817. git-svn-id: https://develop.svn.wordpress.org/trunk@63294 602fd350-edb4-49c9-b593-d223f7449a82
Four independent clean-ups in the test file: - **Remove the unused `$user_ids` fixture.** The property and its `wpSetUpBeforeClass()` method were copied over from the `wp_insert_post()` tests. Nothing in this class references `self::$user_ids`, so the only effect was creating three users for every test in the class. - **Rename `test_wp_delete_post_returns_false_for_invalid_post()`** to `test_wp_delete_post_returns_null_for_already_deleted_post()`. The test asserts `assertNull()`, and that is the correct expectation: for an ID with no matching row, `wp_delete_post()` returns the `null` coming out of `$wpdb->get_row()`, whereas `false` is only returned by the `$post_id <= 0` guard. The old name described the opposite of what the test covers. - **Reuse the `$actions` array** in the assertion loop of `test_wp_delete_post_actions()`. The same six action names were spelled out a second time inline, so the registration loop and the assertion loop could drift apart. - **Fix the `@ticket @63975` annotation.** The stray `@` made the tag invalid, so the test was not associated with the ticket. No assertion was added, removed or changed, and no test behavior changes. Developed in #13036. Follow-up to [60906]. Props Soean. See #65819. git-svn-id: https://develop.svn.wordpress.org/trunk@63295 602fd350-edb4-49c9-b593-d223f7449a82
The `esc_attr()`, `esc_html()`, `esc_js()`, `esc_textarea()`, and `esc_xml()` functions were each annotated `@param string $text`, but none of them has ever required a string at runtime. Both `wp_check_invalid_utf8()` and `_wp_specialchars()` open by casting to string, and that coercion dates to r10298 and r11380, the same year `esc_attr()` and `esc_html()` were introduced in 2.8.0. Only the annotation ever claimed otherwise, which is why passing an integer, overwhelmingly a post ID, a term ID, or a count, has always worked while still registering as a static analysis error. Widen the annotation to `string|int|float` and cast at the top of each function. That cast is not redundant with the ones downstream: it is what makes the `$text` argument handed to the `attribute_escape`, `esc_html`, and `js_escape` filters match its documented `string` type, where callbacks previously received the raw integer or float. For `esc_textarea()` it also affects the output, since that function passed `$text` straight to `htmlspecialchars()`, so `esc_textarea( null )` emitted a deprecation notice on PHP 8.1 and later. The `bool` type is deliberately excluded. Casting `true` yields `'1'` while `false` yields the empty string, and an empty string is indistinguishable from a missing value in any output context. The two call sites in core which pass one stay baselined rather than being permitted by the signature; one of the two is an a11y defect being addressed separately. Regenerating the baselines drops 54 entries covering 101 errors from `tests/phpstan/baselines/argument.type.neon`, where `esc_attr()` was the largest single cluster. Developed in #13044. Follow-up to r11380, r63024. See #65817. git-svn-id: https://develop.svn.wordpress.org/trunk@63296 602fd350-edb4-49c9-b593-d223f7449a82
`current( array_keys( $array ) )` builds a complete array of every key only to read the first one and discard the rest, whereas `array_key_first()` reads the first bucket directly. The function has been native since PHP 7.3, below the current minimum supported version, and core already uses it in `wp_replace_in_html_tags()`. Behavior is unchanged: the toolbar's `$actions` cannot be empty at that point, and in the privacy tools `absint()` normalizes `null` and `false` alike. Developed in #12785. Follow-up to r18788, r42986. Props mukesh27, soean. Fixes #65773. git-svn-id: https://develop.svn.wordpress.org/trunk@63297 602fd350-edb4-49c9-b593-d223f7449a82
…r throws `WP_AI_Client_Prompt_Builder::__call()` stored a caught exception as the error state, but only special-cased generating methods before falling through to the fluent return. The eight support check methods therefore handed back the builder instance, which is truthy, so a failed support check read as a success. Return `false` from support check methods in the `catch` block, matching what they already return when the builder is in a pre-existing error state or when the prompt is prevented by a filter. The error is still recorded, so a later generating call still receives the `WP_Error`. Props bejignesh, irozum, gziolo. Fixes #65781. git-svn-id: https://develop.svn.wordpress.org/trunk@63298 602fd350-edb4-49c9-b593-d223f7449a82
`WP_AI_Client_Prompt_Builder` had no `__clone()`, so cloning it copied the reference to the wrapped `PromptBuilder` instead of the builder itself. That builder mutates its own state, so the clone handed to the `wp_ai_client_prevent_prompt` filter shared its messages and configuration with the original, and a filter could change the prompt that was then sent to the provider, despite the clone being documented as read-only. Add `__clone()` so the wrapped builder, and any stored error, are copied too. The bundled client already implements `PromptBuilder::__clone()` to deep clone messages, model config and request options, it just never ran because only the wrapper was being cloned. Props bejignesh, gziolo. Fixes #65782. git-svn-id: https://develop.svn.wordpress.org/trunk@63299 602fd350-edb4-49c9-b593-d223f7449a82
…HPUnit bootstrap. Developed in #13048. Follow-up to r49535, r51581. Props mukesh27. See #65818. git-svn-id: https://develop.svn.wordpress.org/trunk@63300 602fd350-edb4-49c9-b593-d223f7449a82
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.1)
Can you help keep this open source service alive? 💖 Please sponsor : )