Ticket #16365: 16365v5.diff
File 16365v5.diff, 1.6 KB (added by , 10 years ago) |
---|
-
wp-includes/comment.php
1916 1916 * @param string $new_status New comment status. 1917 1917 * @param string $old_status Previous comment status. 1918 1918 * @param object $comment Comment data. 1919 * 1920 * @since 4.2.0 1921 * 1922 * Introduced a the comment status of 'new' for new comments in wp_new_comment(). 1923 * This allows comment status transitions as described above but for new comments in the 1924 * same way as new posts. 1925 * For example the action 'comment_new_to_approved' is now available, as is 'comment_new_', 1926 * 'comment_new_pingback' and 'comment_new_trackback'. 1919 1927 */ 1920 1928 function wp_transition_comment_status($new_status, $old_status, $comment) { 1921 1929 /* … … 2181 2189 * @since 1.5.0 2182 2190 * @param array $commentdata Contains information on the comment. 2183 2191 * @return int|bool The ID of the comment on success, false on failure. 2192 * @uses wp_transition_comment_status() Passes new and old comment status along with $comment object 2184 2193 */ 2185 2194 function wp_new_comment( $commentdata ) { 2186 2195 if ( isset( $commentdata['user_ID'] ) ) { … … 2233 2242 * @param int $comment_approved 1 (true) if the comment is approved, 0 (false) if not. 2234 2243 */ 2235 2244 do_action( 'comment_post', $comment_ID, $commentdata['comment_approved'] ); 2245 wp_transition_comment_status( $commentdata['comment_approved'], 'new', (object) $commentdata ); 2236 2246 2237 2247 if ( 'spam' !== $commentdata['comment_approved'] ) { // If it's spam save it silently for later crunching 2238 2248 if ( '0' == $commentdata['comment_approved'] ) {