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
Child themes inherit templates and template parts from the parent theme. In Site Editor, the "Added by" column for a template defaults to displaying the child theme, even though it is inherited from the parent, creating confusion as to where the actual templates are located.
This commit ensures that the parent theme is correctly displayed in that scenario.
Follow-up to [51003], [52062].
Props ptahdunbar, WoutPitje, petaryoast, costdev, poena, audrasjb, SergeyBiryukov.
Fixes#55437.
Built from https://develop.svn.wordpress.org/trunk@54860
git-svn-id: http://core.svn.wordpress.org/trunk@54412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit adds inline comments instructing PHPCS to ignore some lines for database queries. An explanation is provided with each instruction.
This resolves a few WPCS warnings along the lines of:
{{{
Use placeholders and $wpdb->prepare(); found interpolated variable $table_name at "DESC $table_name"
}}}
Follow-up to [236], [265], [5778].
Props jipmoors, costdev, jrf, SergeyBiryukov.
Fixes#43761.
Built from https://develop.svn.wordpress.org/trunk@54858
git-svn-id: http://core.svn.wordpress.org/trunk@54410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
While the `$type` and `$label` variables are set to values that do not currently require escaping, this may change in the future, so it is preferable to add the escaping as a defensive coding measure.
Follow-up to [16294], [29030].
Props monzuralam, rudlinkon, hztyfoon, peterwilsoncc.
Fixes#57133.
Built from https://develop.svn.wordpress.org/trunk@54857
git-svn-id: http://core.svn.wordpress.org/trunk@54409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
To improve how Composer dependencies are installed and managed within GitHub Actions, the `ramsey/composer-install` third-party action is now used consistently throughout all workflows.
Previously, some workflows manually ran `composer` commands while others already used `ramsey/composer-install`.
The `ramsey/composer-install` action manages caching dependencies across workflow runs internally, which is something that was manually handled before this change.
Props jrf, desrosj.
Fixes#53841.
Built from https://develop.svn.wordpress.org/trunk@54856
git-svn-id: http://core.svn.wordpress.org/trunk@54408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Includes minor formatting edits for consistency.
Follow-up to [53/tests], [12179], [12946], [35288], [37884], [38810], [38928], [46596], [48131], [52955], [53548], [53813], [53873], [54118], [54316], [54420], [54421], [54803].
See #56792.
Built from https://develop.svn.wordpress.org/trunk@54855
git-svn-id: http://core.svn.wordpress.org/trunk@54407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This adds additional inline context as to why the MacOS job is separate from the Windows and Ubuntu ones in the Test npm workflow.
While it is preferable to combine all of these to avoid repeated code, there is currently no way to determine the runner’s OS within the `if` workflow key.
MacOS jobs use GitHub Action minutes at by a multiple of 10. Being more strict about when to run these jobs ensures minutes are not unintentionally consumed within private forks and mirrors.
See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability for more details.
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54852
git-svn-id: http://core.svn.wordpress.org/trunk@54404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This applies several types of improvements to GitHub Action workflows:
- Updates to inline documentation to ensure accuracy.
- Removal of repetitive or unnecessary debug logging.
- Reorganization of some steps to have configuration steps towards the beginning of jobs.
- Step name updates for consistency across workflows.
Props desrosj, jrf.
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54851
git-svn-id: http://core.svn.wordpress.org/trunk@54403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Because themes are updated independently of Core updates, any deleted files from bundled themes should not be included in the `$_old_files` list.
Any file included in this list is deleted on update, which could cause problems for sites with a given theme active if the removed files were required in earlier versions of that theme and that theme is not updated at the same time.
Props desrosj, costdev, SergeyBiryukov.
Fixes#56936.
Built from https://develop.svn.wordpress.org/trunk@54849
git-svn-id: http://core.svn.wordpress.org/trunk@54401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The parameter was documented as `WP_Post`, but it contains the value of `get_adjacent_post()`, which returns an empty string if there is no corresponding post, so the correct type is `WP_Post|string`.
Follow-up to [11243], [16951], [28111], [32606].
Props apermo, audrasjb.
Fixes#57047.
Built from https://develop.svn.wordpress.org/trunk@54841
git-svn-id: http://core.svn.wordpress.org/trunk@54393 1a063a9b-81f0-0310-95a4-ce76da25c4cd