Opened 11 years ago
Closed 11 years ago
#31012 closed enhancement (duplicate)
In wp_new_comment check for presence of $_SERVER['REMOTE_ADDR']
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Comments | Keywords: | dev-feedback |
| Focuses: | Cc: |
Description
To create comments with the WP REST API, we would like to use wp_new_comment(). This would allow us to take advantage of the filters, actions, and notifications already baked into wp_new_comment().
'wp_new_comment()' does not allow the passing of 'comment_author_IP' and only sets the value from $_SERVER["REMOTE_ADDR"].
For API use the REMOTE_ADDR attribute would not be reliable or populated, and will trigger a PHP Notice of Undefined Index.
https://core.trac.wordpress.org/browser/tags/4.1/src/wp-includes/comment.php#L2073
Change History (1)
Note: See
TracTickets for help on using
tickets.
Duplicate of #14601.