[wp-hackers] possible permanent post and edit page modifications

Owen Winkler ringmaster at midnightcircus.com
Fri Jul 23 14:55:12 UTC 2004


> The plugin action is called after the update to the database:
> 
> do_action('comment_post', $comment_ID);
> 
> This is after the check for moderation, and after the call to 
> notify the 
> author of a moderated comment and after the insert is made. I 
> could do 
> an update to the database and then add my own call to notify 
> the admin 
> of a moderated email, but I wouldn't have the information I 
> need to add 
> my own moderated comment message to the page, just before the 
> comment form.

The current comment form doesn't display a "comments are moderated"
notice in the case that comments are moderated globally.  I would expect
that this part of your hack would require a code change/addition on the
comments page by the user even if you condensed the working bits into a
plugin.

Under 1.3 (and with a little craftiness under 1.2) you can push new
property members into each post of the $posts array that could specify
moderation status for each post from a plugin.  My Adhesive plugin
modifies the date of a sticky post in this way.

> More than that, if I were to get hit by a comment spammer, 
> this is going to be a problem.

I'm not sure why.  Your plugin could reset the comment_approved field to
false before the page was finished executing and nobody would ever see
it.  If you registered your plugin at a high priority, it could act
before other plugins that acted on approved comments.

> Overall it would be just easier to have per-post moderation 
> included as part of the source.

Overall, it would just be easier to have any old feature included as
part of the source, but I'm sure that my hack to turn every "e" in posts
into a picture of a donkey wouldn't be appreciated by the masses.

Still, while I admit an interest in specific feature, I would much
rather see the plugin architecture augmented to better allow plugin
features like this.

For example, if there isn't a hook (or it's in the wrong place) to
prevent comments from going into the database in the first place
(allowing custom comment filters???) seems a failing.

Owen






More information about the hackers mailing list