Digital Sovereignty for everyone

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

  • Trash is the furthest anything goes. When a site sets EMPTY_TRASH_DAYS to 0, core’s wp_trash_comment() deletes permanently instead, so trash is refused there.
  • A spam or trashed comment must be unspammed or untrashed before it is approved or held. Undoing restores the status it had before, from core’s own restore metadata, which a direct status change would leave behind.

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.

If you like this plugin please consider making a donation to further development

Install LHero.org

lhero.org

Open it straight from your home screen, full screen and quicker to load.

  1. Tap the Share button . If you cannot see it, tap ••• first.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add.
  1. Tap the browser menu â‹®.
  2. Tap Install app or Add to Home screen.
  1. In the menu bar, choose File, then Add to Dock.

Use your browser's menu to install this site or add it to your home screen.