[wp-hackers] Modifying wp-comments-post.php to accept new custom fields

MLR mlrichard at gmail.com
Wed Sep 24 20:10:04 GMT 2008


Thanks!

I have yet to implement these suggestions today but I will get back to you
all with my follow-up tomorrow. Thank you for your very specific directions
and information!

Marie-Lynn

On Wed, Sep 24, 2008 at 3:41 AM, Peter Westwood
<peter.westwood at ftwr.co.uk>wrote:

> DD32 wrote:
>
>> Sorry, Seems that filter will be useless, as wp_insert_comment()
>> completely ignores any extra fields which you pass it, So you -will- need to
>> modify core files and add the item to the compact() in wp_insert_comment()
>> too (line 700ish of wp-includes/comment.php)
>>
>>  Yeah it does. :-(
>
> But then it would have to magically guess the field names.
>
> It looks like we need an action in wp_insert_comment which passes the ID of
> the new comment and the $commentdata to the action handlers so they can do
> things based on that - like add extra info to the database.
>
> That way you can collect and process the data on pre_process_comment and
> insert it on the new action hook.
>
> How does that sound?
>
> westi
>
> --
> Peter Westwood
> http://blog.ftwr.co.uk | http://westi.wordpress.com
> C53C F8FC 8796 8508 88D6 C950 54F4 5DCD A834 01C5
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list