Commit Graph

46212 Commits

Author SHA1 Message Date
Jonny Harris
40768e4ebe Cache API: Add wp_cache_flush_group function.
Add a new plugable function called `wp_cache_flush_group`, that will allow developers to clear whole cache groups with a single call. Developers can detect if their current implementation of an object cache supports flushing by group, by calling `wp_cache_supports_group_flush` which returns true if it is supported. If the developers of the object cache drop-in has not implemented `wp_cache_flush_group` and `wp_cache_supports_group_flush`, these functions are polyfilled and `wp_cache_supports_group_flush` defaults to false.

Props Spacedmonkey, filosofo, ryan, sc0ttkclark, SergeyBiryukov, scribu, Ste_95, dd32, dhilditch, dougal, lucasbustamante, dg12345, tillkruess, peterwilsoncc, flixos90, pbearne.
Fixes #4476.

git-svn-id: https://develop.svn.wordpress.org/trunk@53763 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-22 20:50:31 +00:00
Jonathan Desrosiers
bd151a9048 Bundled Themes: Update NPM dependencies for Twenty Twenty and Twenty Nineteen.
There are no changes to any built files after updating.

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53762 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-22 17:09:05 +00:00
Jonathan Desrosiers
f3339e91be Twenty Twenty-One: Update NPM dependencies.
This updates the NPM dependencies for the Twenty Twenty-One theme to the latest versions.

Modifications to the built files are included in this commit, which are a result of updating the `sass` dependency to the latest version.

Previously, trailing loud comments (`/* ... */`) were pushed to the next line,. Now the comment location is preserved, resulting in the built CSS files more closely resembling the theme’s SCSS files.

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53761 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-22 16:40:50 +00:00
Jonny Harris
b7bae6936a REST API: Avoid unnecessarily preparing item links.
Do not call the `prepare_links` methods in core REST API controllers, unless the `_links` or `_embedded` fields are requested. There is no need to prepare links if they are never returned in the response. This saves resources, as many calls to `prepare_links` methods perform database queries. 

Props Spacedmonkey, timothyblynjacobs, rachelbaker, desrosj, dlh, hellofromTonya.
Fixes #52992.

git-svn-id: https://develop.svn.wordpress.org/trunk@53760 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-22 13:58:46 +00:00
Jonny Harris
3506684f2a REST API: Use wp_get_lastest_revision_id_and_total_count function in WP_REST_Posts_Controller class.
Add new function called `wp_get_lastest_revision_id_and_total_count`, that performs an optimized query to get the last revision and total and use it in `WP_REST_Posts_Controller` class. 

Props Spacedmonkey, timothyblynjacobs, furi3r, peterwilsoncc.
Fixes #55857.

git-svn-id: https://develop.svn.wordpress.org/trunk@53759 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-22 13:22:04 +00:00
Sergey Biryukov
e822a9a209 Administration: Correct the escaping in documentation lookup for plugin and theme editor.
This brings consistency to similar code fragments that evolved in slightly different ways over the years:

* A check that the list of functions is not empty now exists in both editors.
* "Function Name..." is an option label, not an attribute, so `esc_html__()` is the correct function here.
* `esc_attr( urlencode( $function ) )` in the theme editor is replaced with `esc_attr( $function )`.
* `htmlspecialchars( $function )` in the theme editor is replaced with `esc_html( $function )`.

Follow-up to [10607], [10879], [11110], [11173], [11204], [11671], [14989].

Props aristath, justinahinon, poena, audrasjb, pratiweb, SergeyBiryukov.
Fixes #56007.

git-svn-id: https://develop.svn.wordpress.org/trunk@53758 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-22 11:31:27 +00:00
Jb Audras
b3b2758455 Docs: Provide a more accurate description for wp_is_theme_directory_ignored().
This function doesn't filter theme directories, it rather determines whether a directory should be ignored during export.

Props audrasjb, nareshbheda.
Fixes #56257.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53757 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-22 07:16:27 +00:00
Sergey Biryukov
334c3ca59d Coding Standards: Use __DIR__ instead of ABSPATH in wp-db.php.
If the file is included directly outside of WordPress core, `ABSPATH` may not be defined.

Follow-up to [53749], [53750], [53755].

See #56268, #55647.

git-svn-id: https://develop.svn.wordpress.org/trunk@53756 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 22:43:24 +00:00
Sergey Biryukov
1bcb9808c9 Coding Standards: Check if the _deprecated_file() function exists in wp-db.php.
This avoids a fatal error if the file is included directly outside of WordPress core, e.g. by HyperDB.

Additionally, replace `WPINC` with `wp-includes`, as the constant may not be defined yet in that context.

Follow-up to [53749], [53750].

See #56268, #55647.

git-svn-id: https://develop.svn.wordpress.org/trunk@53755 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 21:37:03 +00:00
Jb Audras
1d5d9e24c4 Formatting: Normalize to Unicode NFC encoding before converting accent characters in remove_accents().
This changeset adds Unicode sequence normalization from NFD to NFC, via the `normalizer_normalize()` PHP function which is available with the recommended `intl` PHP extension.

This fixes an issue where NFD characters were not properly sanitized. It also provides a unit test for NFD sequences (alternate Unicode representations of the same characters).

Props NumidWasNotAvailable, targz, nacin, nunomorgadinho, p_enrique, gitlost, SergeyBiryukov, markoheijnen, mikeschroder, ocean90, pento, helen, rodrigosevero, zodiac1978, ironprogrammer, audrasjb, azaozz, laboiteare, nuryko, virgar, dxd5001, onnimonni, johnbillion.
Fixes #24661, #47763, #35951.
See #30130, #52654.


git-svn-id: https://develop.svn.wordpress.org/trunk@53754 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 21:09:56 +00:00
Adam Silverstein
ae757491f5 Upgrade/Install: track php extensions and image library support for WebP and AVIF.
Add the loaded php extensions as well as whether the server's image libraries support WebP and AVIF image formats to the data payload sent during upgrade checks. Collecting this data with the WordPress.org API will help the project make more data driven decisions about feature support. Note that all data can still be filtered with the `core_version_check_query_args` filter for privacy reasons.

Props dd32, SergeyBiryukov, mikeschroder, pbiron. 
Fixes #48116.



git-svn-id: https://develop.svn.wordpress.org/trunk@53753 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 20:20:52 +00:00
Jb Audras
e25668d086 Application Passwords: Link a more accurate documentation page in User profile edit screen.
This changeset replaces a HelpHub link with more accurate DevHub link about environment types in User profile edit screen.

Props greg24, whaze.
Fixes #56267.


git-svn-id: https://develop.svn.wordpress.org/trunk@53752 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 19:30:21 +00:00
Adam Silverstein
9bbf3985e3 Media: enable generating multiple mime types for image uploads; specifically WebP versions for JPEG images by default.
This changeset adds the capability for core media uploads to generate sub sized images in more than a single mime type. The output formats for each mime type can be controlled through a filter. WebP is used as an additional output format for JPEG images by default to improve front end performance.

When generating additional mime types, only images which are smaller than the respective original are retained. By default, additional mime type images are only generated for the built-in core image sizes and any custom sizes that have opted in.

Image meta is updated with a new 'sources' array containing file details for each mime type. Each image size in the 'sizes' array also gets a new 'sources' array that contains the image file details for each mime type.

This change also increases image upload retries to accommodate additional image sizes. It also adds a `$mime_type` parameter to the `wp_get_missing_image_subsizes` function and filter.

This change adds three new filters to enable full control of secondary mime image generation and output:

* A new filter `wp_image_sizes_with_additional_mime_type_support` that filters the sizes that support secondary mime type output. Developers can use this to control the output of additional mime type sub-sized images on a per size basis.
* A new filter `wp_upload_image_mime_transforms` that filters the output mime types for a given input mime type. Developers can use this to control generation of additional mime types for a given input mime type or even override the original mime type.
* A new filter `wp_content_image_mimes` which controls image mime type output selection and order for frontend content. Developers can use this to control the mime type output preference order for content images. Content images inserted from the media library will use the available image versions based on the order from this filter.

Thanks to the many contributors who helped develop, test and give feedback on this feature.

A haiku to summarize:

Upload a JPEG
Images of all sizes
Output as WebPs

Props flixos90, MatthiasReinholz, studiolxv, markhowellsmead, eatingrules, pbiron, mukesh27, joegrainger, mehulkaklotar, tweetythierry, akshitsethi, peterwilsoncc, eugenemanuilov, mitogh, shetheliving, clarkeemily, codekraft, mikeschroder, clorith, kasparsd, spacedmonkey, trevorpfromsandee, jb510, scofennellgmailcom, seedsca, cagsmith, karinclimber, dainemawer, baxbridge, grapplerulrich, sobatkras, chynnabenton, tonylocalword, barneydavey, kwillmorth, garymatthews919, olliejones, imarkinteractive, jeffpaul, feastdesignco, webbeetle, masteradhoc.

See #55443.



git-svn-id: https://develop.svn.wordpress.org/trunk@53751 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 18:01:01 +00:00
Sergey Biryukov
0a9e88bafc Coding Standards: Replace the old wp-db.php filename in phpcompat.xml.dist.
This ensures the correct file is allowlisted for use of `mysql_` extension in PHP < 7.0.

Follow-up to [53749].

See #56268, #55647.

git-svn-id: https://develop.svn.wordpress.org/trunk@53750 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 16:07:15 +00:00
Sergey Biryukov
fdb6e13fed Coding Standards: Move wp-includes/wp-db.php to wp-includes/class-wpdb.php.
This renames the file containing the `wpdb` class to conform to the coding standards.

This commit also includes:
* A new `wp-db.php` that loads the new file, for anyone that may have been including the file directly.
* Replacing references to the old filename with the new filename.

Fixes #56268. See #55647.

git-svn-id: https://develop.svn.wordpress.org/trunk@53749 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 15:58:51 +00:00
Jb Audras
b01c8f193b Docs: Update do_action() docblock code example.
This changeset fixes an issue with the code example provided: `do_action()` doesn't return any value.

Props leogermani, thakkarhardik.
Fixes #55977.


git-svn-id: https://develop.svn.wordpress.org/trunk@53748 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 14:30:21 +00:00
Sergey Biryukov
f98e99c8b6 Coding Standards: Adjust the logic slightly in wp_ajax_replyto_comment().
This aims to bring more consistency to the function logic by separating the comment content and type checks from the user existence check.

Follow-up to [8720], [9098], [29758].

See #55647.

git-svn-id: https://develop.svn.wordpress.org/trunk@53747 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 10:57:03 +00:00
Jb Audras
03f47814dd Docs: Add missing function description in wp-admin/includes/template.php.
This changeset also includes a few docblock standards fixes in the same file.

See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53746 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 09:22:22 +00:00
Jb Audras
bf61851c38 Administration: Add labels to read-only form fields.
This changeset improves admin forms accessibility by adding labels to the following read-only form fields:

- Network setup screen: new visible label to the four textareas for code users need to paste into their wp-config file and the server configuration file (web.config or .htaccess).
- `setup-config.php`: new visible label to one textarea for code to include in the `wp-config` file manually.
- Admin toolbar: adds an `arial-label` attribute to the old "shortlink" feature (not used anymore but still activable by plugins).

Props sabernhardt, audrasjb, ryokuhi, joedolson.
Fixes #54302.


git-svn-id: https://develop.svn.wordpress.org/trunk@53745 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 09:02:52 +00:00
Peter Wilson
3a20f3e4c5 Embeds: Add Pocket Casts as a trusted oEmbed provider.
Props mattwondra, peterwilsoncc, pento, audrasjb.
Fixes #55860.



git-svn-id: https://develop.svn.wordpress.org/trunk@53744 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 04:23:57 +00:00
Jb Audras
3c93ce881f Docs: Use third-person singular verbs for function descriptions in wp-admin/includes/comment.php, as per docblocks standards.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53743 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-20 22:14:00 +00:00
Jb Audras
cdd361b90c Docs: Add missing function description in wp-admin/includes/comment.php.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53742 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-20 22:10:29 +00:00
Jb Audras
a925aabc9c Themes: Add a hook to filter theme header image URL.
This changeset introduces the `get_header_image` filter, which can be used to modify header image URL returned by `get_header_image()`, in themes that support the Header Image feature. 

Props hztyfoon, audrasjb, mukesh27, SergeyBiryukov, costdev.
Fixes #56180.


git-svn-id: https://develop.svn.wordpress.org/trunk@53741 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-20 21:11:30 +00:00
Jb Audras
3fbd6a9478 Docs: Use third-person singular verbs for function descriptions in general-template.php, as per docblocks standards.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53740 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-20 20:35:17 +00:00
Jonathan Desrosiers
fbbc402416 Twenty Twenty-One: Rebuild the IE specific stylesheet.
This was missed in [53517].

See #55989.

git-svn-id: https://develop.svn.wordpress.org/trunk@53739 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-20 19:18:06 +00:00
Jonathan Desrosiers
c48672bb83 Build/Test Tools: Add tag pattern matching for the testing NPM workflow.
This workflow was missed in [50298].

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53737 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-20 18:50:36 +00:00
Jonathan Desrosiers
f6e21e2806 Build/Test Tools: Make the GitHub Action pattern matching for tags more specific.
This improves the tag pattern matching for GitHub Action workflows to be more specific. The `*` wildcard in the current patterns matches any character except slash (`/`). While this correctly matches a version like `X.Y.Z`, it could also match non-numeric characters.

This changes patterns to use the `+` character, which matches one or more of the preceding characters (`[0-9]` in this case).

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53736 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-20 18:39:16 +00:00
Jonathan Desrosiers
b2b8a0c3d2 Build/Test Tools: Correctly detect the first workflow run for a branch or tag.
When trying to determine the outcome of the previous run for a GitHub Action workflow, the current run is included in the list fetched from the GitHub API.

This adjusts the logic checking for the previous run to account for that and fixes notifications for the first workflow runs of a new branch or tag.

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53735 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-20 17:41:02 +00:00
Sergey Biryukov
a93aae282c Docs: Add a @since note for get_post_permalink() returning false on failure.
Follow-up to [53733].

See #45329.

git-svn-id: https://develop.svn.wordpress.org/trunk@53734 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-20 15:44:10 +00:00
Sergey Biryukov
b698f8f475 Posts, Post Types: Correct the check for non-existing post in get_post_permalink().
The function was erroneously calling `is_wp_error()` on the result of a `get_post()` call, which returns `null` on failure, and never returns a `WP_Error` object.

Previously, passing a non-existing post ID to the function would result in a home URL being returned and a few `Attempt to read property "post_type, post_name, hierarchical..." on null` PHP warnings.

This commit ensures `get_post_permalink()` returns `false` on failure, which brings parity with `get_permalink()`.

Includes a unit test to confirm the correct behavior.

Follow-up to [12923], [13023], [32606].

Props renegeuze, manzoorwani.jk.
Fixes #45329.

git-svn-id: https://develop.svn.wordpress.org/trunk@53733 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-20 15:39:18 +00:00
Sergey Biryukov
57f4d6c7b2 Tests: Correct the test for passing all expected parameters to the preprocess_comment filter.
Previously, `assertSame()` was replaced with `assertSameSets()`, which does not preserve the array keys. `assertSameSetsWithIndex()` should have been used instead.

Follow-up to [36038], [48937], [53729], [53730].

See #55647, #56244.

git-svn-id: https://develop.svn.wordpress.org/trunk@53732 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-20 14:47:39 +00:00
Jonathan Desrosiers
2dba3831f5 Administration: Remove unused CSS selectors related to old format menu icons.
This removes all CSS definitions related to the `.icon16` class. Research shows that current ecosystem usage of this class is extremely minimal.

This selector was used for the Welcome Panel and Welcome Screen in WordPress 3.3 (see [19163] and [19197]. The icons were removed for WordPress 3.5 in [22018], but the related CSS remained, and were also included when the MP6 admin re-skinning was merged in [26072].

Props afercia, mmaumio, isabel_brison, sabernhardt, audrasjb, desrosj.
Fixes #35717.

git-svn-id: https://develop.svn.wordpress.org/trunk@53731 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-20 14:37:26 +00:00
Sergey Biryukov
906a564d44 Coding Standards: Remove extra comma in a compact() call.
This fixes a PHP compatibility error in `wp_handle_comment_submission()`:

* `Trailing comma's are not allowed in function calls in PHP 7.2 or earlier`

Follow-up to [53729].

See #55647, #56244.

git-svn-id: https://develop.svn.wordpress.org/trunk@53730 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-20 14:20:13 +00:00
SergeyBiryukov
87534545ed Coding Standards: Standardize on user_id when passing data to comment functions.
The `wp_new_comment()`, `wp_update_comment()`, and `wp_filter_comment()` functions already normalize the `user_ID` parameter internally to `user_id`, which matches the database field name.

This commit aims to bring some consistency when passing the parameter in core.

The corresponding `$user_ID` variable is also renamed to `$user_id` to match the other variables when not referring to the `$user_ID` global, which has an exception in the WordPress coding standards.

Follow-up to [8543], [8720], [12267], [12300], [26491], [28915], [28922], [34799], [49303].

See #55647, #56244.

git-svn-id: https://develop.svn.wordpress.org/trunk@53729 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-20 14:12:02 +00:00
Jb Audras
5d8e134e9f Docs: Use third-person singular verbs for function descriptions in block-template.php and block-template-utils.php.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53728 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-20 13:19:51 +00:00
Jb Audras
6cea6ead66 Docs: Fix indentation issues in block-template-utils.php docblocks, as per docs standards.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53727 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-20 13:12:30 +00:00
Jb Audras
efee559016 Plugins: Improve color contrast on plugins screen when recovery mode is activated.
This changeset replaces `#d63638` (contrast ratio: 4.40) with `#b32d2e` (contrast ratio: 5.87) in Plugins screen row action links when the site is in recovery mode.

Props kebbet, mukesh27, joedolson, audrasjb.
Fixes #56190.


git-svn-id: https://develop.svn.wordpress.org/trunk@53726 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-20 11:35:14 +00:00
Jonathan Desrosiers
2437ef5130 External Libraries: Update the Moment library to version 2.29.4.
This is a minor bug fix release.

Props dilipbheda.
Fixes #56031.

git-svn-id: https://develop.svn.wordpress.org/trunk@53725 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-19 19:41:12 +00:00
Sergey Biryukov
e49f452f65 Coding Standards: Use consistent placement for ::prepare_links() methods.
This moves the `::prepare_links()` methods in REST API classes next to `::prepare_item_for_response()` where they are used, to bring some consistency across the classes and make code navigation easier.

Includes wrapping some long lines for better readability.

Follow-up to [52079], [52051], [52342], [53721], [53722].

See #55647.

git-svn-id: https://develop.svn.wordpress.org/trunk@53724 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-19 16:20:54 +00:00
Sergey Biryukov
788a070963 Coding Standards: Rename $comment_post_ID and $comment_author_IP variables in various files.
This fixes two WPCS warnings:
* `Variable "$comment_post_ID" is not in valid snake_case format`
* `Variable "$comment_author_IP" is not in valid snake_case format`

While matching the database fields of the same name, these variables did not follow the WordPress coding standards, and are now renamed to address that.

Note: The name change only affects internal variables and parameters for a few actions receiving a comment post ID:

* `edit_comment`
* `comment_id_not_found`
* `comment_closed`
* `comment_on_trash`
* `comment_on_draft`
* `comment_on_password_protected`
* `pre_comment_on_post`

The change does not affect parameters for functions receiving an array of comment data:

* `wp_insert_comment()`
* `wp_new_comment()`
* `wp_update_comment()`
* `wp_handle_comment_submission()`

The associated array keys still match the database fields: `comment_post_ID` and `comment_author_IP`.

Follow-up to [1706], [2894], [8720], [28427], [28437], [28457], [34799], [53720],

See #55647, #56244.

git-svn-id: https://develop.svn.wordpress.org/trunk@53723 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-19 16:17:56 +00:00
Jonny Harris
eaad35de6b REST API: Add prepare_links method to WP_REST_Taxonomies_Controller class.
Move logic to from `prepare_item_for_response` to `prepare_links` method to bring `WP_REST_Taxonomies_Controller` class inline with other REST API controllers.

Props Spacedmonkey, timothyblynjacobs, dlh.
Fixes #56020.

git-svn-id: https://develop.svn.wordpress.org/trunk@53722 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-19 14:52:12 +00:00
Jonny Harris
847d40743a REST API: Add prepare_links method to WP_REST_Post_Types_Controller class.
Move logic to from `prepare_item_for_response` to `prepare_links` method to bring `WP_REST_Post_Types_Controller` class inline with other REST API controllers.

Props Spacedmonkey, timothyblynjacobs, dlh.
Fixes #56019.

git-svn-id: https://develop.svn.wordpress.org/trunk@53721 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-19 14:47:45 +00:00
Sergey Biryukov
92ba1bb88e Coding Standards: Remove unused variable in wp-trackback.php.
This was present in the initial import of b2 files, but appears to have never been used in WordPress core.

Follow-up to [3], [636], [637], [1616].

See #55647.

git-svn-id: https://develop.svn.wordpress.org/trunk@53720 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-19 14:15:35 +00:00
Sergey Biryukov
b49a83cb4c Coding Standards: Improve variable names in wp-trackback.php.
This fixes a `Variable "$comment_post_ID" is not in valid snake_case format` WPCS warning.

`$comment_post_ID`, while matching the database field of the same name, does not follow the WordPress coding standards, so the variable is now renamed to `$comment_post_id`.

Additionally, these variables are renamed for clarity:

* `$tb_id` to `$post_id` (this was not the trackback ID)
* `$tb_url` to `$trackback_url`

Follow-up to [172], [637], [1616], 

See #55647, #56244.

git-svn-id: https://develop.svn.wordpress.org/trunk@53719 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-19 14:00:35 +00:00
Greg Ziółkowski
41475f336e Editor: Fix register_block_type does not recognise ancestor block setting
When registering block through PHP, using `register_block_type` function, newly introduced `ancestor` block setting in `block.json` was not recognised. It worked though, when block is registered from JavaScript.

Props lovor, annezazu.
Fixes #56184.




git-svn-id: https://develop.svn.wordpress.org/trunk@53718 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-19 13:22:31 +00:00
Jb Audras
9db156e7c7 Upgrade/Install: Improve plugin update icon alignment.
This changeset improves the vertical alignment of the plugin update button in the Plugins screen.

Props Presskopp, sabernhardt, costdev, eherman24.
Fixes #56123.


git-svn-id: https://develop.svn.wordpress.org/trunk@53717 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-19 09:23:20 +00:00
Jb Audras
9b323cd393 Twenty Twenty-One: Add block type suggestions to block patterns.
When using a given block, patterns which use that block can be suggested. This changeset adds `blockType` suggestion for several Twenty Twenty-One bundled patterns.

Props ryelle, poena, audrasjb.
Fixes #53647.


git-svn-id: https://develop.svn.wordpress.org/trunk@53716 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-19 08:54:57 +00:00
Sergey Biryukov
a855e85c77 Posts, Post Types: Standardize on $post parameter name where appropriate.
This renames the `$post_id` or `$id` parameters to `$post` for functions that accept a post ID or post object:

* `get_sample_permalink()`
* `get_sample_permalink_html()`
* `wp_check_post_lock()`
* `wp_set_post_lock()`
* `get_the_tags()`
* `comment_class()`
* `get_comment_class()`
* `get_comments_link()`
* `get_comments_number()`
* `comments_number()`
* `get_comments_number_text()`
* `comments_open()`
* `pings_open()`
* `comment_form()`
* `do_trackbacks()`
* `pingback()`
* `post_permalink()`
* `get_post_permalink()`
* `get_edit_post_link()`
* `edit_post_link()`
* `get_delete_post_link()`
* `post_class()`
* `get_post_class()`
* `the_attachment_link()`
* `wp_get_attachment_link()`
* `wp_list_post_revisions()`
* `check_and_publish_future_post()`
* `add_ping()`
* `get_pung()`
* `get_to_ping()`
* `wp_get_post_revisions()`
* `wp_get_post_revisions_url()`

Additionally, `$revision_id` is renamed to `$revision` in:

* `wp_restore_post_revision()`
* `wp_delete_post_revision()`

Includes minor documentation improvements for consistency and code layout fixes for better readability.

Follow-up to [1599], [1794], [2881], [3303], [3851], [5302], [6633], [6716], [6985], [7103], [7149], [7747], [8011], [8638], [8643], [8695], [9138], [9273], [11425], [11922], [11956], [12284], [12810], [12923], [13023], [13171], [25567], [27156], [27473], [28558], [28602], [33659], [38852], [47276], [47366], [48622], [49544], [49597], [52095].

See #56243, #55647.

git-svn-id: https://develop.svn.wordpress.org/trunk@53715 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-18 17:35:51 +00:00
Sergey Biryukov
7573385d95 Coding Standards: Use MINUTE_IN_SECONDS where appropriate.
This aims to clarify the time units for some timeout or expiration values.

Follow-up to [11823], [13177], [21996], [37747].

See #55647.

git-svn-id: https://develop.svn.wordpress.org/trunk@53714 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-17 02:16:27 +00:00
Sergey Biryukov
b05fbba55e Coding Standards: Use a single input array on Permalink Settings screen.
This reduces the amount of code to edit in case of any changes to the default permalink structures.

Follow-up to [53706], [53710].

See #55647, #55498.

git-svn-id: https://develop.svn.wordpress.org/trunk@53713 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-17 01:36:27 +00:00