Notes

One moderation path

Every change goes through LH_Comment_Moderation_Moderator, whether an ability or a front-end link asked for it, so the rules and the audit trail are the same for an AI agent and for a moderator on the page. It uses core’s own functions (wp_set_comment_status(), wp_spam_comment(), wp_trash_comment() and their undo counterparts, wp_update_post()), so every core and plugin hook on those actions still fires.

Front-end links

LH_Comment_Moderation_Frontend adds Unapprove (Approve on a held comment), Spam, Trash and Edit links after the comment text, through comment_text at priority 100, added on template_redirect. Links appear only for logged-in users with moderate_comments and edit_comment, on singular views, in the page body (after wp_body_open, or the block-template render window), never in feeds. Each link goes to admin-post.php?action=lh_comment_moderation_frontend with a nonce tied to the action and the comment, runs the action with source web, then returns to the referring page. Filter lh_comment_moderation_return_link_actions to change which actions are offered. Markup classes: lh-comment-moderation-links on the wrapper and lh-comment-moderation-{action} on each link; no stylesheet is shipped.

Nothing is deleted

Permissions and sites

Every ability needs moderate_comments on the site it acts on (filter: lh_comment_moderation_return_required_capability), plus edit_comment for each comment or edit_post for each post. The abilities are registered with meta.site_scoped, so with LH MCP Adapter Extensions active they take an optional site_id and run on that site, with the permission checked there. The plugin must be network-activated for that to reach every site.

Audit trail

With LH Audit Trail active, each change records comment.moderated (action, before and after status, post, source mcp or web) or post.discussion_changed (before and after settings, source), with the current user as actor and the comment’s or post’s author as subject. Both are kept 370 days, readable with moderate_comments, and not shown on members’ own audit trails.

Origin

Built for lh-tasks #152464, after a site audit found no way to moderate comments without wp-admin. 0.3.0 absorbed LH Frontend Comment Moderation (lh-tasks #152474), which is retired.