Commit Graph

13479 Commits

Author SHA1 Message Date
Jb Audras
16041a3913 Docs: Replace multiple single line comments with multi-line comments.
This changeset updates various comments as per WordPress PHP Inline Documentation Standards.
See https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#5-inline-comments.

Follow-up to [56174], [56175], [56176], [56177], [56178].

Props costdev, audrasjb.
See #58459.




git-svn-id: https://develop.svn.wordpress.org/trunk@56179 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-09 21:38:35 +00:00
Jb Audras
bf911a96a8 Docs: Replace multiple single line comments with multi-line comments.
This changeset updates various comments as per WordPress PHP Inline Documentation Standards.
See https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#5-inline-comments.

Follow-up to [56174], [56175], [56176], [56177].

Props costdev, audrasjb.
See #58459.




git-svn-id: https://develop.svn.wordpress.org/trunk@56178 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-09 21:23:34 +00:00
Jb Audras
3b68269941 Docs: Replace multiple single line comments with multi-line comments.
This changeset updates various comments as per WordPress PHP Inline Documentation Standards.
See https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#5-inline-comments.

Follow-up to [56174], [56175], [56176].

Props costdev, audrasjb.
See #58459.




git-svn-id: https://develop.svn.wordpress.org/trunk@56177 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-09 20:15:03 +00:00
Sergey Biryukov
a6895dff86 Coding Standards: Use strict comparison in wp-includes/class-wp-user-query.php.
Follow-up to [31669], [47808].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@56169 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-09 09:57:16 +00:00
Jb Audras
e62dfe87ce Docs: Docblock correction in WP_REST_Attachments_Controller::upload_from_data().
The `$data` parameter in `WP_REST_Attachments_Controller::upload_from_data()` is passed and treated only as `string`, not `array`.

Props costdev.
See #57840.




git-svn-id: https://develop.svn.wordpress.org/trunk@56168 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-08 21:57:17 +00:00
Jb Audras
07d58c1356 Docs: Update link to MovableType docs (on Internet Archive).
Follow-up to [56165].

Props SergeyBiryukov.
Fixes #58760.
See #57840.




git-svn-id: https://develop.svn.wordpress.org/trunk@56167 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-08 13:19:31 +00:00
Sergey Biryukov
e91908aeb6 Coding Standards: Use strict comparison in wp-includes/class-wp-tax-query.php.
Follow-up to [16413], [16849].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@56166 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-08 10:46:20 +00:00
Jb Audras
a357b7adc8 Docs: Update link to MovableType documentation.
Props mujuonly.
Fixes #58760.
See #57840.




git-svn-id: https://develop.svn.wordpress.org/trunk@56165 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-08 07:41:09 +00:00
Felix Arntz
96c64cd42d Media: Avoid programmatically created images within post content from incorrectly receiving fetchpriority="high".
Follow-up to [56037], as that changeset accidentally did not consider the changes made in [55825]: Images that are programmatically injected into post content (e.g. through a block, or shortcode, or any hook calling a function like `wp_get_attachment_image()`) must be treated as part of the whole post content blob since otherwise the heuristics for applying `fetchpriority="high"` and `loading="lazy"` are skewed by parsing certain images before others rather than sequentially parsing the entire post content. [55825] addressed that for lazy-loading, but when [56037] introduced `fetchpriority` support, the related refactor missed making the same consideration for that attribute.

Props flixos90, spacedmonkey, thekt12, mukesh27.
Fixes #58235.
See #58089.


git-svn-id: https://develop.svn.wordpress.org/trunk@56164 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-07 18:06:49 +00:00
Adam Silverstein
9781ffbca5 Revisions: return existing autosave after saving with unchanged data.
Correctly return the existing autosave when an unchanged autosave is saved, instead of returning an error.

Fix regressions after r55154 where an error and not the original autosave was returned when saving with unchanged data (for example, clicking the preview button repeatedly). Returning the autosave (ID) is the expected behavior for the endpoint.

Follow up to [55154]

Props Mamaduka, jeroenrotty, mrfoxtalbot.
Fixes #58739.



git-svn-id: https://develop.svn.wordpress.org/trunk@56163 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-07 17:51:11 +00:00
Isabel Brison
7035b615c4 Editor: rename sync_status and move it to top level.
Renames sync_status to wp_pattern_sync_status and moves it to top level field of wp_block post type.

Props glendaviesnz, aaronrobertshaw, mukesh27, peterwilsoncc.
Fixes 58677.


git-svn-id: https://develop.svn.wordpress.org/trunk@56160 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-07 07:27:53 +00:00
Isabel Brison
f47b9a2075 Editor: update npm packages with bug fixes and blessed tasks.
Includes miscellaneous bug fixes and enhancements to the Library task (#58579) and to the Command Palette task (#58643).

See #58745.


git-svn-id: https://develop.svn.wordpress.org/trunk@56159 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-07 07:18:46 +00:00
Sergey Biryukov
d113821dbb Coding Standards: Use strict comparison in wp-includes/class-wp-simplepie-file.php.
Follow-up to [10687].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@56158 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-07 06:40:11 +00:00
John Blackbourn
a7de2a8e26 Docs: Correct the formatting of various filter documentation.
See #57840


git-svn-id: https://develop.svn.wordpress.org/trunk@56157 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-07 00:34:26 +00:00
John Blackbourn
82302c4ffb REST API: Correct some filter docblocks.
See #57752


git-svn-id: https://develop.svn.wordpress.org/trunk@56156 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-06 23:21:34 +00:00
Felix Arntz
21490c6ba4 Media: Ensure that the image widget supports loading optimization attributes.
This changeset adds support for loading optimization attributes such as `loading="lazy"` and `fetchpriority="high"` to the image widget. A new context `widget_media_image` is introduced for that purpose.

Props spacedmonkey, thekt12, mukesh27, westonruter.
Fixes #58704.
See #58235.


git-svn-id: https://develop.svn.wordpress.org/trunk@56154 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-06 16:31:02 +00:00
Jb Audras
e9d0712b49 Docs: Use third-person singular verbs in various function descriptions of load.php, as per docblocks standards.
See #57840.



git-svn-id: https://develop.svn.wordpress.org/trunk@56153 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-06 14:15:00 +00:00
Jb Audras
d2993600fe Boostrap/Load: Incorrect condition in wp_check_php_mysql_versions().
This changeset adds a check for the existence of `db.php` at the default path `ABSPATH . 'wp-content/db.php'`, even if `WP_CONTENT_DIR` is defined and `db.php` 
is placed in `WP_CONTENT_DIR`.

Follow-up to [49161].

Props mikeyzm, SergeyBiryukov, hztyfoon, 
Fixes #58201.




git-svn-id: https://develop.svn.wordpress.org/trunk@56152 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-06 13:52:56 +00:00
Jb Audras
c49225f9be Coding Standards: Add missing newline at the end of wp-admin/user.php.
Follow-up to [56150].

See #58194.




git-svn-id: https://develop.svn.wordpress.org/trunk@56151 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-06 12:52:59 +00:00
Jb Audras
b71668fc40 Users: Remove password reset links when the feature is not allowed for a specific user.
This also introduces `wp_is_password_reset_allowed_for_user()` which returns `false` when password reset is not allowed for a specific user. This can be 
filtered by developers using the existing `allow_password_reset` hook.

Props ocean90, cshark, robinwpdeveloper, tahmina1du, kraftbj.
Fixes #58194.




git-svn-id: https://develop.svn.wordpress.org/trunk@56150 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-06 12:45:45 +00:00
Isabel Brison
21c74f1870 Editor: fix comment indentation.
Fixes multiline comment indentation in `wp-includes/block-supports/settings.php`. Also fixes typo in the comment.

Props mukesh27.
See #58586.


git-svn-id: https://develop.svn.wordpress.org/trunk@56146 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-06 04:39:03 +00:00
Isabel Brison
9d141e5a5e Editor: update template titles in browse mode.
Adds more meaningful titles to templates in the browse mode template list.

Props ntsekouras, audrasjb.
Fixes #58713.


git-svn-id: https://develop.svn.wordpress.org/trunk@56145 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-06 03:02:57 +00:00
Felix Arntz
ebd03692e6 Media: Ensure that large images before the main query loop are counted towards lazy-loading threshold.
Following [55318], [55847], and [56142], certain images in the header of the page have received support for potentially receiving `fetchpriority="high"` and having the `loading="lazy"` attribute omitted. However, these images being present did not affect the "content media count" which counts the images towards a certain threshold so that the first ones are not lazy-loaded.

This changeset also increases that count for such header images if they are larger than a certain threshold. The threshold is used to avoid e.g. a header with lots of small images such as icon graphics to skew the lazy-loading behavior.

Props thekt12, spacedmonkey, flixos90.
Fixes #58635.


git-svn-id: https://develop.svn.wordpress.org/trunk@56143 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-05 21:36:23 +00:00
Felix Arntz
aee525ee6f Media: Ensure custom header image tag supports loading optimization attributes.
This changeset is a follow up to [56037] and ensures that the `get_header_image_tag()` function receives the benefits of `wp_get_loading_optimization_attributes()` as well. Prior to `fetchpriority` support, this was not needed since the header image should never be lazy-loaded, but the image certainly is a `fetchpriority` candidate, so therefore it is crucial to have it supported.

Props felipeelia, spacedmonkey, mukesh27, westonruter, flixos90.
Fixes #58680.


git-svn-id: https://develop.svn.wordpress.org/trunk@56142 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-05 19:28:02 +00:00
John Blackbourn
f7dbb2462b General: Increase the minimum supported version of PHP to 7.0.0.
This also removes the random compat library which is no longer necessary, and adjusts unit tests and CI workflows that no longer need to take PHP 5.6 into account.

Thank you for your service, PHP 5. Onwards!

Props SergeyBiryukov, mukesh27, dingo_d, audrasjb, jrf, costdev, azaozz, JavierCasares, hellofromTonya, samiamnot, spacedmonkey, masteradhoc, knutsp, garyjones, chanthaboune

Fixes #57345


git-svn-id: https://develop.svn.wordpress.org/trunk@56141 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-05 17:39:55 +00:00
David Baumwald
28fa6d1a34 Default Filters: Correct hook type for wp_print_scripts and customize_controls_print_styles.
Props Cybr, bhi3315.
Fixes #58665.

git-svn-id: https://develop.svn.wordpress.org/trunk@56140 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-05 16:19:39 +00:00
Jb Audras
6e1f9dfbcd Editor: Fix font paths in iframed editor.
By making font asset files URLs absolute instead of relative, this ensures each font asset file does properly relate to the actual location of the files.

See https://github.com/WordPress/gutenberg/pull/50875.

Props ironprogrammer, antonvlasenko, ndiego, shuvo247, robinwpdeveloper.
Fixes #58672.




git-svn-id: https://develop.svn.wordpress.org/trunk@56139 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-05 12:32:52 +00:00
Sergey Biryukov
80494d2e8a General: Revert strict comparison in WP_List_Util for now.
Casting the values to a string causes `Array to string conversion` PHP warnings, so using loose comparison restores the previous behavior for code relying on type juggling when using the `wp_list_filter()` function, e.g. comparing a numeric string to an integer.

The unit test case added for this scenario in the previous commit remains. 

Follow-up to [55908], [56137].

See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@56138 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-05 11:13:26 +00:00
Sergey Biryukov
c11f70878f General: Compare values as strings in WP_List_Util::filter() and ::sort_callback().
This aims to preserve backward compatibility for code relying on type juggling when using the `wp_list_filter()` function, e.g. comparing a numeric string to an integer.

Follow-up to [55908].

Props azaozz, jeremyfelt, david.binda.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@56137 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-05 10:44:20 +00:00
Jb Audras
c3e17e4ccb Editor: Normalize paths in register_core_block_style_handles().
Previously, this function did not normalize paths before using `glob()` or registering styles. This led to a mixture of forward-slashes and back-slashes in 
Windows environments.

This change uses `wp_normalize_path()` to ensure Windows compatibility.

Props wildworks, costdev, kafleg, mukesh27.
Fixes #58711.




git-svn-id: https://develop.svn.wordpress.org/trunk@56136 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-05 07:14:20 +00:00
Andrew Ozz
56af1e4b94 HTML API: Fix a fatal error when processing malformed document with unclosed attribute.
Props: dlh, costdev, dmsnell.
Fixes: #58637.

git-svn-id: https://develop.svn.wordpress.org/trunk@56133 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-04 20:43:43 +00:00
Sergey Biryukov
e834fed6eb Options, Meta APIs: Check if the gmt_offset value is numeric in sanitize_option().
When saving the settings via the admin UI, the default value for any options not passed in the current `$_POST` request is set to `null` in `wp-admin/options.php`. Some options, e.g. `blog_public`, then rely on `null` being passed to `update_option()` to determine whether the value was changed or not.

This commit resolves a PHP 8.1 deprecation notice when saving the `gmt_offset` option without any changes:
{{{
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
}}}

Includes a similar fix for the `blog_charset` option.

Follow-up to [4112], [4329], [5541], [21849].

Props adi3890, dhrupo, hrdelwar, hasanmisbah, oglekler, mukesh27, SergeyBiryukov.
Fixes #57728.

git-svn-id: https://develop.svn.wordpress.org/trunk@56132 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-04 13:40:55 +00:00
David Baumwald
1815f4c76c Post WordPress 6.3 Beta 3 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@56130 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-03 17:05:33 +00:00
David Baumwald
0b4b351eac WordPress 6.3 Beta 3.
git-svn-id: https://develop.svn.wordpress.org/trunk@56129 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-03 16:39:53 +00:00
Sergey Biryukov
94aaa2d9bc HTTP API: Declare a few default parameters in WP_Http_Curl and WP_Http_Streams.
This resolves `Undefined array key` PHP warnings when trying to access any of these values in `WP_Http_Curl::request()` or `WP_Http_Streams::request()`:

* `$parsed_args['decompress']`
* `$parsed_args['stream']`
* `$parsed_args['filename']`

Follow-up to [10410], [11236], [13274], [17555], [37428], [42766], [44346].

Props sjoerdlinders, hellofromTonya, jrf, oglekler, Clorith, SergeyBiryukov.
Fixes #52622.

git-svn-id: https://develop.svn.wordpress.org/trunk@56128 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-03 14:01:25 +00:00
Isabel Brison
d1f9292a14 Editor: update npm packages with bug fixes and blessed tasks.
Includes miscellaneous bug fixes and enhancements to the Library task (#58579) and to the site vs content editing task (#58641)

Fixes #58701.


git-svn-id: https://develop.svn.wordpress.org/trunk@56127 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-03 09:11:14 +00:00
Isabel Brison
ab9d5e3218 Editor: adds deprecation for deleted block_core_navigation_submenu_build_css_colors function.
Adds the `block_core_navigation_submenu_build_css_colors` function to `wp-includes/deprecated.php`. Follow-up to #58623.

Props ramonopoly, peterwilsoncc.
See #58623.


git-svn-id: https://develop.svn.wordpress.org/trunk@56126 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-03 06:55:58 +00:00
Isabel Brison
6aaf01313a Editor: Enqueue commands package styles.
Enqueues the stylesheet from the commands package which holds the CSS for the Command Palette feature.

Props wildworks.
Fixes #58667.


git-svn-id: https://develop.svn.wordpress.org/trunk@56125 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-03 06:48:46 +00:00
Jb Audras
7f0eb0780f Docs: Fix image_get_intermediate_size() docblock.
The description of returned values in array was incorrect for `image_get_intermediate_size()`:
- `$file` returns the filename of image, no path information
- `$path` returns path relative to the uploads directory, not absolute

Props crstauf, sccr410.
Fixes #58686.
See #57840.




git-svn-id: https://develop.svn.wordpress.org/trunk@56122 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-01 23:08:43 +00:00
Sergey Biryukov
1d773d4174 Docs: Correct @return description for wp_count_posts().
Add a note that `wp_count_posts()` returns an empty object if the post type passed to the function does not exist.

Follow-up to [6730], [6808], [8081], [24826], [29093], [51885].

Props crstauf, Ov3rfly.
Fixes #58685.

git-svn-id: https://develop.svn.wordpress.org/trunk@56120 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-01 10:02:05 +00:00
John Blackbourn
be90d79cb5 General: Ignore invalid types for the '_wp_http_referer' URL query variable.
It's expected that this query variable contains a string when it's set, but it's possible for its type to be something else such as an array. Ignoring non-string values prevents cascading errors when its value is passed through functions that expect a string.

Props xknown, costdev, jrf, azaozz

Fixes #57670


git-svn-id: https://develop.svn.wordpress.org/trunk@56115 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-29 23:25:38 +00:00
Felix Arntz
60b3fe7997 Media: Fix inconsistent docs for existing wp_img_tag_add_loading_attr filter and remove duplicate.
Follow-up to [56037].

Props thekt12.
See #58235.


git-svn-id: https://develop.svn.wordpress.org/trunk@56112 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-29 17:32:35 +00:00
Felix Arntz
e0aaa2ac9b General: Add missing parentheses to functions referenced in _deprecated_function() calls added in 6.3.
See #58235, #58301, #58555.


git-svn-id: https://develop.svn.wordpress.org/trunk@56110 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-29 15:31:49 +00:00
Jb Audras
8c9fffb5cc Editor: Allow Query Block to show posts from multiple selected authors.
This changeset adds handler for multiple cases where author data can be passed to the Query Block:
- array: array of author ids
- string: comma separated author ids
- integer: single author id

Props adi3890, costdev, mayur8991, oglekler.
Fixes #58426.




git-svn-id: https://develop.svn.wordpress.org/trunk@56109 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-29 13:28:49 +00:00
Isabel Brison
41277f1f1b REST API: updates test annotations for global styles revisions
Adds `@covers` annotations to tests and fixes incorrect spacing.

Props ramonopoly, mukesh27.
See #58524.


git-svn-id: https://develop.svn.wordpress.org/trunk@56105 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-29 06:47:43 +00:00
Isabel Brison
d966798bfc Editor: update duotone support.
Updates duotone support after stabilisation of selectors API and adds a few small code quality and UI improvements.

Props onemaggie, peterwilsoncc, ajlende, audrasjb, mikeschroder, ramonopoly.
Fixes #58555.


git-svn-id: https://develop.svn.wordpress.org/trunk@56101 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-29 06:19:41 +00:00
David Baumwald
91a95fe91c Post WordPress 6.3 Beta 2 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@56100 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-28 23:26:16 +00:00
David Baumwald
e1405a5b9c WordPress 6.3 Beta 2.
git-svn-id: https://develop.svn.wordpress.org/trunk@56099 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-28 22:59:40 +00:00
Bernie Reiter
f39bf114c0 Editor: Update npm packages to fix gutenberg_ prefix
Update `@wordpress/*` packages to the latest patch versions in
order to replace calls to `gutenberg_apply_colors_support` with
`wp_apply_colors_support` in order to avoid a fatal error.

Props joemcgill, spacedmonkey, flixos90, ironprogrammer, sabernhardt.
Fixes #58651.

git-svn-id: https://develop.svn.wordpress.org/trunk@56098 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-28 22:36:22 +00:00
Joe McGill
260e97646d Build/Test Tools: Update terser-webpack-plugin.
This bumps the `terser-webpack-plugin` dependency to version `5.3.9`, which fixes an error during the minification process of the `@wordpress/block-library` package during builds.

Props clorith, azaozz, desrosj.
Fixes #58660, See #57657.


git-svn-id: https://develop.svn.wordpress.org/trunk@56097 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-28 20:06:56 +00:00