Opened 10 years ago
Closed 10 years ago
#5822 closed enhancement (duplicate)
Extending ajax parameters
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.0 |
Component: | Activity | Keywords: | |
Cc: |
Description
Hi,
This ticket follows this BuddyPress thread.
This is about extending the data passed on ajax calls on activity comments form. Currently, the ajax data is hard-coded as such :
var ajaxdata = { action: 'new_activity_comment', 'cookie': bp_get_cookies(), '_wpnonce_new_activity_comment': jq("#_wpnonce_new_activity_comment").val(), 'comment_id': comment_id, 'form_id': form_id[2], 'content': content.val() };
The purpose here is being able to apply filters on this data, to declare additionnal data on ajax calls. I'm not sure WordPress offers the possibility to apply filter directly in JS, although I stumbled on this trac ticket.
Change History (2)
Note: See
TracTickets for help on using
tickets.
Perhaps the
.serialize()
method could be utilised here?For example:
Then in whatever function is hooked to
new_activity_comment
you can do stuff like:This way, if users make changes to the comment form input fields, they can access their custom data.