Commit Graph

647 Commits

Author SHA1 Message Date
Weston Ruter
c14a2c926d Code Modernization: Comments: Use null coalescing operator instead of isset() ternaries.
Developed as a subset of https://github.com/WordPress/wordpress-develop/pull/10654
Initially developed in https://github.com/WordPress/wordpress-develop/pull/4886

Follow-up to [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403].

Props costdev, westonruter.
See #58874, #63430.

Built from https://develop.svn.wordpress.org/trunk@61434


git-svn-id: http://core.svn.wordpress.org/trunk@60746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-01-05 05:53:29 +00:00
John Blackbourn
133d50d5a2 Docs: Miscellaneous improvements and corrections to inline documentation.
See #64224

Built from https://develop.svn.wordpress.org/trunk@61387


git-svn-id: http://core.svn.wordpress.org/trunk@60699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-12-16 20:21:37 +00:00
Weston Ruter
55ffbba205 Export: Update export_wp() to handle get_comment() returning null due to filter.
The `get_comment` filter now explicitly documents returning `null` in addition to a `WP_Comment` object. This allows the filter to be used to exclude comments from an export. The `get_comment()` function already supported returning `null`.

Developed in https://github.com/WordPress/wordpress-develop/pull/8383

Props abcd95, WPExplorer, desrosj, mukesh27, westonruter, SirLouen, lbones, mdibrahimk48, audrasjb, jorbin, wildworks, hellofromTonya, saurabh.dhariwal, mabfahad.
Fixes #61244.

Built from https://develop.svn.wordpress.org/trunk@61369


git-svn-id: http://core.svn.wordpress.org/trunk@60681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-12-11 01:55:35 +00:00
Sergey Biryukov
db8d425e41 Notes: Avoid incrementing comment_count when notes are resolved or reopened.
Follow-up to [60987].

Props hbhalodia, wildworks, shimotomoki, gulamdastgir04, JeffPaul, ellatrix, SergeyBiryukov.
Fixes #64325.
Built from https://develop.svn.wordpress.org/trunk@61336


git-svn-id: http://core.svn.wordpress.org/trunk@60648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-12-01 15:33:32 +00:00
Weston Ruter
a49aba3014 Docs: Add missing descriptions and fix types for some @return tags.
Props huzaifaalmesbah, sabernhardt, westonruter.
See #64224.
Fixes #64262.

Built from https://develop.svn.wordpress.org/trunk@61270


git-svn-id: http://core.svn.wordpress.org/trunk@60582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-11-19 06:17:32 +00:00
Adam Silverstein
575bdf57ea Notes: trash (or delete) child notes when parent is deleted.
Ensure that when a top level note is trashed (or deleted), all of its replies (children) are also trashed or deleted.  If EMPTY_TRASH_DAYS is 0, notes are deleted immediately; otherwise they are marked as trash for later cleanup.

Props adamsilverstein, desrosj, wildworks, mamaduka, karthickmurugan, jeffpaul, shailu25.
Fixes #64240.


Built from https://develop.svn.wordpress.org/trunk@61248


git-svn-id: http://core.svn.wordpress.org/trunk@60560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-11-15 13:44:33 +00:00
Adam Silverstein
c0db6ac66c Notes: refine post author notifications.
Code maintenance follow up to r61179. Move `wp_new_comment_via_rest_notify_postauthor` callback from REST API Comments controller to comment.php. Add default to `wp_notes_notify` for multisite compatibility.

Props adamsilverstein, justlevine, mukesh27, mamaduka, peterwilsoncc, desros.
See #64204.


Built from https://develop.svn.wordpress.org/trunk@61199


git-svn-id: http://core.svn.wordpress.org/trunk@60535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-11-10 22:51:35 +00:00
ellatrix
e37891ef9a Notes: notify post author on note submission.
Fix an issue where new notes did not trigger a notification because they are submitted via the REST API. Ensures REST API submissions (for notes) trigger the post author notification. Leverage existing comment notification infrastructure.

Developed in https://github.com/WordPress/wordpress-develop/pull/10472.

Fixes #64204.
Props adamsilverstein, mamaduka, peterwilsoncc, ellatrix, wildworks, mukesh27, desrosj, annezazu, jeffpaul.
Built from https://develop.svn.wordpress.org/trunk@61179


git-svn-id: http://core.svn.wordpress.org/trunk@60515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-11-07 14:07:34 +00:00
Adam Silverstein
afcbc33f65 Editor: fix contributor "Slow down" message when updating Notes quickly.
Fix an issue where contributors’ notes edits were throttled. Notes are internal and from trusted users, they do not need throttling. 

Skip calling wp_allow_comment for notes in WP_REST_Comments_Controller::create_item. As a result the pre_comment_approved hook is also not fired for notes. 

Fixes https://github.com/WordPress/gutenberg/issues/72892 where the issue was originally reported.

Props adamsilverstein, desrosj, wildworks, mamaduka.
Fixes #64199.


Built from https://develop.svn.wordpress.org/trunk@61144


git-svn-id: http://core.svn.wordpress.org/trunk@60480 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-11-05 20:34:28 +00:00
Aaron Jorbin
ccb6766a85 Coding Standards: Fix alignment
In [61089], `auth_callback` was added which is causing phpcs to complain about the alignment with the other arguments in the array.

Follow-up to [61089] and [61036].

See #64153, #63168.


Built from https://develop.svn.wordpress.org/trunk@61138


git-svn-id: http://core.svn.wordpress.org/trunk@60474 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-11-04 19:22:30 +00:00
Adam Silverstein
59991fff9b Editor: Notes should not appear in the context of comments.
Prevent notes from inadvertently showing up in the context of comments - including on the Dashboard recent comments widget and the “Mine” count on the Comments page. Notes are stored as a custom ‘note’ comment type and this change ensures the note type is only returned when explicitly requested, or when ‘all’ types are requested.

The query for note children is modified to return all child notes. This fixes an issue where children were no longer being returned for the ‘note’ type.

Also fixes https://github.com/WordPress/gutenberg/issues/72548.


Props adamsilverstein, timothyblynjacobs, shailu25, peterwilsoncc, westonruter, mamaduka, kadamwhite.
Fixes #64145.
Fixes #64152.


Built from https://develop.svn.wordpress.org/trunk@61105


git-svn-id: http://core.svn.wordpress.org/trunk@60441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-31 18:57:30 +00:00
wildworks
3bdd50e5c4 Editor: Add auth_callback to _wp_note_status comment meta.
Adds an `auth_callback` to the `_wp_note_status` comment meta so that only users with the `edit_comment` capability can update this meta field via the REST API. 

This is necessary to ensure that users can properly resolve or reopen Notes.

Props wildworks, adamsilverstein, westonruter, mamaduka, desrosj.
Fixes #64153.
Built from https://develop.svn.wordpress.org/trunk@61089


git-svn-id: http://core.svn.wordpress.org/trunk@60425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-30 11:56:37 +00:00
Aaron Jorbin
cf38be60a7 Coding Standards: Fix blank spaces.
Nice to meet you, where you been?

See #63168.

Built from https://develop.svn.wordpress.org/trunk@61036


git-svn-id: http://core.svn.wordpress.org/trunk@60372 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 14:03:27 +00:00
Adam Silverstein
956747c6e8 Editor: Introduce the PHP-related code for Notes.
Bring the PHP part of the new Notes feature into core for the 6.9 release. See related Gutenberg Issue: https://github.com/WordPress/gutenberg/issues/71826. These changes do not impact any user facing functionality, they simply prepare core for the JavaScript functionality that will come over in a separate sync.

Overview of changes:
- Ensure Notes are not included in comment counts
- Enable the note type  (REST API)
- Adjust capabilities so edit_post cap implies ability to edit notes  
- Enable empty and duplicate notes for resolve/re-open actions  
- Add control over notes with post type supports check
- Register new note resolution status meta

Props: ristojovanovic, adamsilverstein, jeffpaul, wildworks, mamaduka, swissspidy, timothyblynjacobs, kadamwhite.
Fixes #64096.


Built from https://develop.svn.wordpress.org/trunk@60987


git-svn-id: http://core.svn.wordpress.org/trunk@60323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-20 19:22:33 +00:00
Sergey Biryukov
cadbf4a842 Coding Standards: Remove unnecessary conditional from do_trackbacks().
The check for a truthy `$to_ping` value is redundant, as a falsey value would cause the function to return early a few lines above.

Follow-up to [1794], [2612].

Props justlevine.
See #63268.
Built from https://develop.svn.wordpress.org/trunk@60406


git-svn-id: http://core.svn.wordpress.org/trunk@59742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-07-02 16:44:31 +00:00
Sergey Biryukov
bef3863e28 Coding Standards: Explicitly return null in get_page_of_comment().
This matches the documented `@return` type.

Follow-up to [9367].

Props justlevine.
See #63268.
Built from https://develop.svn.wordpress.org/trunk@60362


git-svn-id: http://core.svn.wordpress.org/trunk@59698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-06-29 17:47:33 +00:00
Sergey Biryukov
abe9603d9f Docs: Correct parameter and return types for some comment functions.
This commit corrects some parameter type issues concerning arrays. More specifically:

* `separate_comments()` now correctly indicates that it returns an array of `WP_Comment` objects, keyed by their string types.
* `_close_comments_for_old_posts()` now correctly indicates that it both takes and returns an array of `WP_Post` objects.

Follow-up to [8892], [8897], [8949], [32587], [42876].

Props justlevine, johnbillion.
See #63268.
Built from https://develop.svn.wordpress.org/trunk@60330


git-svn-id: http://core.svn.wordpress.org/trunk@59666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-06-20 17:06:36 +00:00
John Blackbourn
ca29540645 Docs: Improvements and corrections to documentation relating to metadata.
See #63166
Built from https://develop.svn.wordpress.org/trunk@60264


git-svn-id: http://core.svn.wordpress.org/trunk@59600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-05-29 23:09:28 +00:00
Sergey Biryukov
efdd94e890 Coding Standards: Pass true instead of 1 to current_time() for consistency.
This matches the documented type of `bool` for the `$gmt` parameter.

Follow-up to [60119].

Props johnbillion, dilipbheda.
Fixes #63207.
Built from https://develop.svn.wordpress.org/trunk@60235


git-svn-id: http://core.svn.wordpress.org/trunk@59571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-05-14 11:59:34 +00:00
Sergey Biryukov
d857f68a25 Coding Standards: Use strict comparison in wp_check_comment_data().
Follow-up to [2894], [28437], [59319].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.
Built from https://develop.svn.wordpress.org/trunk@59975


git-svn-id: http://core.svn.wordpress.org/trunk@59317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-03-11 21:58:24 +00:00
Sergey Biryukov
70faf15ca6 Coding Standards: Use strict comparison in check_comment().
Follow-up to [1012], [1737], [48121].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.
Built from https://develop.svn.wordpress.org/trunk@59957


git-svn-id: http://core.svn.wordpress.org/trunk@59299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-03-09 23:04:29 +00:00
Sergey Biryukov
6a904137d2 Coding Standards: Use strict comparison in wp_insert_comment().
Includes type casting `$comment_approved` to an integer to avoid breaking WP-CLI tests, since the value can be passed as a string.

Follow-up to [3104], [3193], [3887], [59903].

Props swissspidy.
See #62279.
Built from https://develop.svn.wordpress.org/trunk@59915


git-svn-id: http://core.svn.wordpress.org/trunk@59257 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-03-03 20:59:21 +00:00
Pascal Birchler
582128f4f2 Coding Standards: Revert strict comparison added in [59898].
`$comment_approved` can be both a string or an integer, so this change had unintended consequences such as breaking WP-CLI tests.

See #62279.
Built from https://develop.svn.wordpress.org/trunk@59903


git-svn-id: http://core.svn.wordpress.org/trunk@59245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-03-03 09:05:37 +00:00
Sergey Biryukov
bd3842f01d Coding Standards: Use strict comparison in wp_insert_comment().
Follow-up to [3104], [3193], [3887].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.
Built from https://develop.svn.wordpress.org/trunk@59898


git-svn-id: http://core.svn.wordpress.org/trunk@59240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-03-02 19:48:21 +00:00
Sergey Biryukov
9300a155ae Coding Standards: Use strict comparison in privacy_ping_filter().
Follow-up to [3548], [3885].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.
Built from https://develop.svn.wordpress.org/trunk@59887


git-svn-id: http://core.svn.wordpress.org/trunk@59229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-02-28 11:27:20 +00:00
Sergey Biryukov
91f31a5169 Docs: Correct the type for transition_comment_status action parameters.
By the time this hook runs, the `$new_status` and `$old_status` values can only be a string.

Follow-up to [26491].

See #62281.
Built from https://develop.svn.wordpress.org/trunk@59871


git-svn-id: http://core.svn.wordpress.org/trunk@59213 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-02-26 15:03:25 +00:00
Sergey Biryukov
4f774af5e8 Coding Standards: Use strict comparison in wp_transition_comment_status().
Follow-up to [9195].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.
Built from https://develop.svn.wordpress.org/trunk@59867


git-svn-id: http://core.svn.wordpress.org/trunk@59209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-02-25 17:51:24 +00:00
Sergey Biryukov
d685ee9b02 Docs: Correct DocBlock formatting for wp_check_comment_disallowed_list().
Follow-up to [6553], [48121], [48575].

See #62281.
Built from https://develop.svn.wordpress.org/trunk@59864


git-svn-id: http://core.svn.wordpress.org/trunk@59206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-02-24 07:07:16 +00:00
Sergey Biryukov
73276fe471 Docs: Correct DocBlock formatting for wp_check_comment_data().
Follow-up to [59319].

See #62281.
Built from https://develop.svn.wordpress.org/trunk@59863


git-svn-id: http://core.svn.wordpress.org/trunk@59205 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-02-24 06:36:20 +00:00
Sergey Biryukov
6b79b04807 Coding Standards: Use strict comparison in get_page_of_comment().
Follow-up to [9367], [9522], [9808].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.
Built from https://develop.svn.wordpress.org/trunk@59860


git-svn-id: http://core.svn.wordpress.org/trunk@59202 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-02-23 05:15:25 +00:00
Sergey Biryukov
d8b45098da Coding Standards: Use strict comparison in wp_delete_comment().
Follow-up to [3271], [47219].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.
Built from https://develop.svn.wordpress.org/trunk@59852


git-svn-id: http://core.svn.wordpress.org/trunk@59194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-02-21 00:35:22 +00:00
Sergey Biryukov
2c77ef11d2 Coding Standards: Use strict comparison in wp_new_comment_notify_postauthor().
Follow-up to [2894], [34106], [34250], [34545], [36119].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.
Built from https://develop.svn.wordpress.org/trunk@59841


git-svn-id: http://core.svn.wordpress.org/trunk@59183 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-02-20 03:19:24 +00:00
Sergey Biryukov
5f01118b48 Coding Standards: Use strict comparison in wp_new_comment_notify_moderator().
Follow-up to [2894], [34106], [34250], [34252], [35339].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.
Built from https://develop.svn.wordpress.org/trunk@59840


git-svn-id: http://core.svn.wordpress.org/trunk@59182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-02-19 19:29:22 +00:00
Sergey Biryukov
1422cf9d49 Coding Standards: Use strict comparison in pingback().
Follow-up to [2983], [38852].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.
Built from https://develop.svn.wordpress.org/trunk@59827


git-svn-id: http://core.svn.wordpress.org/trunk@59169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-02-16 18:35:24 +00:00
Sergey Biryukov
6c1001fb95 Coding Standards: Use strict comparison in wp_get_comment_status().
Follow-up to [546], [2258], [5666], [47219], [47808].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.
Built from https://develop.svn.wordpress.org/trunk@59826


git-svn-id: http://core.svn.wordpress.org/trunk@59168 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-02-15 02:33:23 +00:00
Felix Arntz
19f101215e Pings/Trackbacks: Add return value to pingback().
This facilitates debugging and better response / error handling, among other things.

Props audrasjb, coquardcyr, dshanske, ironprogrammer, NathanAtmoz, pbearne, shulard, soulseekah.
Fixes #38197.

Built from https://develop.svn.wordpress.org/trunk@59818


git-svn-id: http://core.svn.wordpress.org/trunk@59160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-02-12 23:45:25 +00:00
Peter Wilson
cf9594c4ae Options/Meta APIs: Document type juggling of meta data.
Document that unserialised data types are stored as strings in the database and returned as such by the meta data functions. For example, setting meta data to the integer value `1` will be returned as `"1"` when subsequently queried via `get_metadata()` and the related functions.

Props sukhendu2002, azaozz, jrf, rodrigosprimo.
Fixes ticket:61950.



Built from https://develop.svn.wordpress.org/trunk@59657


git-svn-id: http://core.svn.wordpress.org/trunk@59000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-01-17 00:12:26 +00:00
Sergey Biryukov
097229b3ab Coding Standards: Use strict comparison in wp_handle_comment_submission().
Follow-up to [549], [1985], [2464], [2556], [2558], [34799], [40667].

Props deepakrohilla, narenin.
See #62316.
Built from https://develop.svn.wordpress.org/trunk@59556


git-svn-id: http://core.svn.wordpress.org/trunk@58942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-12-22 22:44:23 +00:00
Sergey Biryukov
7b9673722e Comments: Use a more precise check for disallowed keys on filtered comment data.
The previous approach of running `wp_allow_comment()` twice could have unintended consequences, e.g. the `check_comment_flood` action was also triggered twice, which might lead to false-positive identification of comment flood in case there is some custom callback hooked to it, which is not expecting identical data seeing twice.

This commit introduces a new function, `wp_check_comment_data()`, to specifically check for disallowed content before and after comment data is filtered.

Follow-up to [59267].

Props david.binda, SergeyBiryukov.
See #61827.
Built from https://develop.svn.wordpress.org/trunk@59319


git-svn-id: http://core.svn.wordpress.org/trunk@58705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-10-29 15:38:19 +00:00
Sergey Biryukov
aed49756e0 Docs: Adjust comments about set_time_limit() per the documentation standards.
Includes splitting long comments into multiple lines and moving a few comments above the `function_exists()` check for more consistent placement.

Follow-up to [59039], [59288].

See #62281.
Built from https://develop.svn.wordpress.org/trunk@59291


git-svn-id: http://core.svn.wordpress.org/trunk@58683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-10-25 20:26:20 +00:00
Sergey Biryukov
4318418b39 Comments: Validate new comments before and after comment data is filtered.
This ensures that a Disallowed Comment Keys match will consistently send the comment to the Trash, by checking both the original unmodified comment data and the final filtered comment data.

If the first check has already resulted in a `trash` or `spam` status, the second check is skipped as redundant.

Follow-up to [2894], [3851], [48121], [48575].

Props cfinke, kbrownkd, thompsonsj, mi5t4n, devspace, chaion07, engahmeds3ed, SergeyBiryukov.
Fixes #61827.
Built from https://develop.svn.wordpress.org/trunk@59267


git-svn-id: http://core.svn.wordpress.org/trunk@58659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-10-21 23:07:15 +00:00
Peter Wilson
8c3dd2eb88 General: Remove noopener from links opening in a new tab.
Removes the automatic addition of `rel="noopener noreferrer"` from links targeting a new tab or window, `target='_blank'`. Since this was introduced, supported browsers have changed their security policies and no longer allow the opened link to have JavaScript access to the previous tab.

Deprecates:

* `wp_targeted_link_rel()`
* `wp_targeted_link_rel_callback()`
* `wp_init_targeted_link_rel_filters()`: converted to a noop function
* `wp_remove_targeted_link_rel_filters()`: converted to a noop function

The deprecated functions are retained in `formatting.php` as in `SHORTINIT` mode the file is included while `deprecated.php` is not.

This also removes the `noopener` from links hard coded within the WordPress dashboard linking to documentation and other resources.

Props audrasjb, azaozz, dhruval04, dorzki, neo2k23, presskopp, sabernhardt, swissspidy, tobiasbg.
Fixes #53843.

Built from https://develop.svn.wordpress.org/trunk@59120


git-svn-id: http://core.svn.wordpress.org/trunk@58516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-09-30 05:19:16 +00:00
Aaron Jorbin
723d01e3e1 Bootstrap/Load: Ensure uses of set_time_limit are documented why.
`set_time_limit` can cause unexpected behavior so it general should be avoided. There are instances though where they should be used so those instances should be properly documented.

Props Rcrayno, ryan, kurtpayne, jorbin.
Fixes #21521. See #19487.

Built from https://develop.svn.wordpress.org/trunk@59039


git-svn-id: http://core.svn.wordpress.org/trunk@58435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-09-17 22:41:13 +00:00
Sergey Biryukov
8532edd526 Docs: Further clarify return results for a non-existing ID in metadata functions.
This adds a note that the functions return either an empty array or an empty string for a valid but non-existing ID, depending on the `$single` parameter.

Follow-up to [48658], [50641].

Props rodrigosprimo, jrf.
See #61608.
Built from https://develop.svn.wordpress.org/trunk@58962


git-svn-id: http://core.svn.wordpress.org/trunk@58358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-09-01 18:30:16 +00:00
Aaron Jorbin
01876b0906 Comments: Expire comment author cookies after 1 year (rather than 0.95129375951 of a year)
This filter was originally added in [19622] which predates the addition of the constant added in [21996] by 24085717 seconds.

Props peterwilsoncc, khokansardar, krupalpanchal.
Fixes #61412.

Built from https://develop.svn.wordpress.org/trunk@58401


git-svn-id: http://core.svn.wordpress.org/trunk@57850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-13 13:05:13 +00:00
Pascal Birchler
f97698702d General: Consistently cast return value to int in functions that use ceil().
The return value of `ceil()` is still of type `float` as the value range of `float` is usually bigger than that of `int`.

Props crstauf, audrasjb.
Fixes #58683.
Built from https://develop.svn.wordpress.org/trunk@57648


git-svn-id: http://core.svn.wordpress.org/trunk@57149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-17 15:24:08 +00:00
John Blackbourn
eadb61542a Docs: Various improvements and corrections to inline documentation.
See #59651

Built from https://develop.svn.wordpress.org/trunk@57644


git-svn-id: http://core.svn.wordpress.org/trunk@57145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-16 21:47:12 +00:00
Sergey Biryukov
8f3e5f1640 Coding Standards: Rename the $ID parameter to $post_id in trackback().
This resolves a few WPCS warnings:
{{{
Variable "$ID" is not in valid snake_case format, try "$i_d"
}}}

See #59650.
Built from https://develop.svn.wordpress.org/trunk@57530


git-svn-id: http://core.svn.wordpress.org/trunk@57031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-04 18:46:14 +00:00
spacedmonkey
8aca3fdc68 Comments: Improve WP_Comment_Query count query performance by setting 'order by' to 'none'.
In cases where `WP_Comment_Query` or `get_comments` is employed with the 'count' parameter set to true, specify 'order by' as 'none'. Since these queries serve solely to determine the count of comments matching specific query parameters, the 'order by' clause becomes redundant and places unnecessary strain on the database server, resulting in slower query execution. Given that count queries are executed on every admin request to retrieve comment counts, this change enhances the performance of the wp-admin interface.

Props guss77, davidbaumwald, SergeyBiryukov, westonruter, peterwilsoncc, foliovision, hareesh-pillai, spacedmonkey.
Fixes #58368
Built from https://develop.svn.wordpress.org/trunk@56747


git-svn-id: http://core.svn.wordpress.org/trunk@56259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-29 17:13:24 +00:00
Sergey Biryukov
d8936a9fe7 Coding Standards: Remove superfluous blank lines at the end of various functions.
Note: This is enforced by WPCS 3.0.0.

Follow-up to [56536], [56547].

Props jrf.
See #59161, #58831.
Built from https://develop.svn.wordpress.org/trunk@56548


git-svn-id: http://core.svn.wordpress.org/trunk@56060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-08 10:03:21 +00:00