CommentForm final class
Minn\Runtime\CommentForm · public/minn/src/Minn/Runtime/CommentForm.php · 107 lines
The comment form's submission with plugins loaded (wp_handle_comment_submission), in the order the reference runs it (contracts/runtime.md "The comment form"): a reply to a comment still held is refused; the post is looked at, each refusal with its action (comment_id_not_found, comment_closed, comment_on_trash, comment_on_draft, comment_on_password_protected) and pre_comment_on_post when it takes comments; the signed-in user's own name and addresses replace the form's, or a site that requires sign-in refuses; the required fields, an empty comment (allow_empty_comment) and the column lengths are checked; then wp_new_comment stores it, where preprocess_comment, the duplicate and flood checks and pre_comment_approved have their say. A refusal is a WP_Error whose data is the status the form answers with; none means a blank page.
Public
| static | submit(array $form): WP_Comment|WP_Error# | The stored comment, or the refusal the form answers with.
|
Internals 3
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | store(array $data, string $content): WP_Comment|WP_Error# | The comment checked for content and length, then stored through wp_new_comment. @param array<string, mixed> $data
| |||
| private | postRefusal(int $postId): ?WP_Error# | Why the post takes no comment, or null after pre_comment_on_post when it does. | |||
| private | fieldRefusal(WP_User $user, string $author, string $email): ?WP_Error# | A signed-out commenter's name and email, when the site requires them. |
Nothing matches.