CommentCloser final readonly class
Minn\Runtime\CommentCloser · public/minn/src/Minn/Runtime/CommentCloser.php · 30 lines
The Discussion setting that closes comments on old posts. Observed on the reference: only the "post" type closes (the types filter changes nothing), status is not consulted, the age is whole days on post_date_gmt and must exceed the setting (a fifteen-day-old post stays open at fifteen), and zero days switches the rule off.
Constants and properties
| private | readonly bool $enabled | Promoted from the constructor. |
| private | readonly int $days | Promoted from the constructor. |
Public
| new | __construct(bool $enabled, int $days)# | ||||
| method | open(bool $open, Minn\Content\PostRecord|array|null $post, int $now): bool# | Whether comments stay open on a post under the close-after-days setting. | |||
| method | closes(string $postType, string $postDateGmt, array $types, int $now): bool# | Whether the setting closes a post of $postType published at $postDateGmt: the type is one of $types, the setting is on, and the post is older than the days allowed. The posts a single query hands over (_close_comments_for_old_posts) take their types from the close_comments_for_post_types filter, which is honoured there.
|
Nothing matches.