As the filter is only intended for a single test, it can be converted to a closure instead of being declared as a function in the global namespace. The `remove_filter()` part is redundant, as `WP_UnitTestCase_Base` saves the state of filter-related globals at `set_up()` and restores them on `tear_down()`.
Follow-up to [54175].
Props jrf, SergeyBiryukov.
See #56791.
Built from https://develop.svn.wordpress.org/trunk@54917
git-svn-id: http://core.svn.wordpress.org/trunk@54469 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add some minimal e2e test coverage to install and activate the Gutenberg plugin.
This will catch naming collisions between Core and Gutenberg and help avoid crashing WordPress installations that run the stable version of the Gutenberg plugin on top of Core trunk.
Props costdev.
Fixes#57197.
Built from https://develop.svn.wordpress.org/trunk@54913
git-svn-id: http://core.svn.wordpress.org/trunk@54465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This fixes the currently flagged `WordPress.PHP.StrictInArray.MissingTrueStrict` issues:
* `Not using strict comparison for in_array; supply true for third argument.`
These all do comparisons with strings, so all the more reason why it is imperative that a strict comparison is used.
Follow-up to [47550], [47557], [54155], [53480].
Props jrf.
See #56791.
Built from https://develop.svn.wordpress.org/trunk@54895
git-svn-id: http://core.svn.wordpress.org/trunk@54447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In [54352] `update_post_caches()` was replaced by `_prime_post_caches()` to reduce excessive object cache calls. That's because `_prime_post_caches()` checks first if post IDs aren't already cached. Unfortunately this becomes an issue if a post itself is cached but not the meta/terms.
To fix this regression, `_prime_post_caches()` now always calls `update_postmeta_cache()` and `update_object_term_cache()` depending on the arguments passed to it. Both functions internally check whether IDs are already cached so the fix from [54352] remains in place.
Props peterwilsoncc, spacedmonkey, ocean90.
Fixes#57163.
Built from https://develop.svn.wordpress.org/trunk@54894
git-svn-id: http://core.svn.wordpress.org/trunk@54446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds a `private` visibility to some test class properties where it was not explicitly specified. This continues the previous efforts to make sure visibility is declared on all properties.
Note: This will be enforced by WPCS 3.0.0.
Follow-up to [49184], [51919], [52009], [52010], [54889].
Props jrf.
See #56791.
Built from https://develop.svn.wordpress.org/trunk@54890
git-svn-id: http://core.svn.wordpress.org/trunk@54442 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds a `public` visibility to test fixtures, tests, data providers, and callbacks methods. This continues the previous efforts to make sure visibility is declared on all methods.
Note: This will be enforced by WPCS 3.0.0.
Follow-up to [51919], [52009], [52010].
Props jrf.
See #56791.
Built from https://develop.svn.wordpress.org/trunk@54889
git-svn-id: http://core.svn.wordpress.org/trunk@54441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `check_comment()` and `wp_check_comment_disallowed_list()` functions are expected to be case-insensitive, but that only worked for words using Latin script and consisting of ASCII characters.
This commit adds the Unicode flag to the regular expression used for the check in these functions, so that both pattern and subject can be treated as UTF-8 strings.
Reference: [https://www.php.net/manual/en/reference.pcre.pattern.modifiers.php PHP Manual: Pattern Modifiers].
Follow-up to [984], [2075], [48121], [48575].
Props bonjour52, SergeyBiryukov.
Fixes#57207.
Built from https://develop.svn.wordpress.org/trunk@54888
git-svn-id: http://core.svn.wordpress.org/trunk@54440 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In the "Blog (alternative)" page template, turn post titles into links. This is to better align with user expectations that individual post titles in a blog-like list of recent posts will be links to the corresponding blog posts.
Props scruffian.
Fixes#57175.
Built from https://develop.svn.wordpress.org/trunk@54887
git-svn-id: http://core.svn.wordpress.org/trunk@54439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The handle source can be set to `false`, which means the item is an alias of other items it depends on.
Follow-up to [7970], [25518], [43661], [47170], [48462], [54470].
Props mehulkaklotar, swissspidy, costdev.
Fixes#57206.
Built from https://develop.svn.wordpress.org/trunk@54875
git-svn-id: http://core.svn.wordpress.org/trunk@54427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Since `ABSPATH` is defined and documented to end with a forward slash `/`, this changeset removes the first `/` from strings appended to `ABSPATH` in various files, leading to `//` in the resulting path.
Props TobiasBg, audrasjb, SergeyBiryukov, emanuelx.
Fixes#57074.
See #57071.
Built from https://develop.svn.wordpress.org/trunk@54872
git-svn-id: http://core.svn.wordpress.org/trunk@54424 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset removes the "flexible-header" tag from Twenty Nineteen, since the requirements for using this tag is that the theme includes support for a custom header with the flex-height and/or flex-width parameters, and Twenty Nineteen does not have support for header image.
Props poena, mukesh27, laurelfulford, audrasjb.
Fixes#46213.
Built from https://develop.svn.wordpress.org/trunk@54869
git-svn-id: http://core.svn.wordpress.org/trunk@54421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates some inline comments to better match the guidelines and recommendations set forth in the make/core and make/docs handbooks:
> In general, use second person in your documentation. Second person depicts a friendly tone, with a perfect focus on the reader. In addition to this, directly addressing the reader helps avoid passive voice; thereby preventing unwanted confusion.
> ...
> the word “we” should be avoided (...) unless its made very clear which group is speaking.
Includes:
* Replacing first-person usage of "we" with second person point of view.
* Making small clarification adjustments where the voice is much too casual or lacks clear context, especially for non-native English speakers.
References:
* [https://make.wordpress.org/docs/style-guide/language-grammar/grammatical-person/ Style Guide: Grammatical person]
* [https://make.wordpress.org/docs/handbook/documentation-team-handbook/handbooks-style-and-formatting-guide/ Handbooks & HelpHub Style and Formatting Guide]
* [https://make.wordpress.org/core/handbook/best-practices/post-comment-guidelines/#style-and-substance Post & Comment Guidelines: Style and Substance]
Follow-up to [2176], [3430], [4676], [6009], [7991], [12688], [12762], [26008], [28978], [44488], [44962], [51979], [53131], [53132], [53156], [53131], [54200].
Props ironprogrammer, costdev, jorbin, SergeyBiryukov.
See #57052.
Built from https://develop.svn.wordpress.org/trunk@54866
git-svn-id: http://core.svn.wordpress.org/trunk@54418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `setUp()` and `tearDown()` methods were renamed to `set_up()` and `tear_down()`, respectively, as part of implementing the `void` return type solution for PHPUnit 8.0.
Follow-up to [29120], [29251], [30277], [32173], [32806], [38829], [42379], [50450], [51276], [51568].
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54865
git-svn-id: http://core.svn.wordpress.org/trunk@54417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
These tests ensure that `wp_generate_attachment_metadata()` stores the file size of all newly uploaded attachments under the `filesize` array key. The tests were initially supposed to be committed with [52837].
Follow-up to [52837], [52932], [54861].
Props spacedmonkey, johnwatkins0, mitogh, adamsilverstein, pbearne, SergeyBiryukov.
Fixes#57171.
Built from https://develop.svn.wordpress.org/trunk@54863
git-svn-id: http://core.svn.wordpress.org/trunk@54415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to make the tests more discoverable and easier to expand.
Includes splitting the `wp_filesize` and `pre_wp_filesize` filter tests into a separate test case.
Follow-up to [52837], [52932], [54402].
Props pbearne, spacedmonkey, SergeyBiryukov.
See #57171.
Built from https://develop.svn.wordpress.org/trunk@54861
git-svn-id: http://core.svn.wordpress.org/trunk@54413 1a063a9b-81f0-0310-95a4-ce76da25c4cd