Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $comment_id = wp_new_comment( $commentdata );
- $comment = get_comment($comment_id);
- /*
- Another WordPress rant. Thursday, April 22nd, 2010
- ---------------------------------------------------------------------------
- I found this beautiful bit of code on line 80 of wp-comments-post.php.
- I dont't even think I need much explaining to do here.. but this is just
- another reason why this software is so effed up. Instead of instantiating
- a Comment class with the commentdata - or better - a new comment and adding
- the data a bit at a time, the wp_new_comment function is called from the
- *global* namespace.
- Then you have to use a get_comment function to actually fetch the comment
- because instead of having the actual comment obj, you've only got the ID.
- How many queries is this? How much of a fucking pain in the ass is it?
- How hard is it for a developer, in their template, to echo $comment->body
- instead of a ridiculous the_comment() function inside of a "magical loop".
- @@@@@@ @@@@@@@ @@@@@@@@ @@@@@@@@ @@@ @@@ @@@ @@@
- @@@@@@@@ @@@@@@@@ @@@@@@@@@ @@@@@@@@@ @@@ @@@ @@@ @@@
- @@! @@@ @@! @@@ !@@ !@@ @@! @@@ @@! @@@
- !@! @!@ !@! @!@ !@! !@! !@! @!@ !@! @!@
- @!@!@!@! @!@!!@! !@! @!@!@ !@! @!@!@ @!@!@!@! @!@!@!@!
- !!!@!!!! !!@!@! !!! !!@!! !!! !!@!! !!!@!!!! !!!@!!!!
- !!: !!! !!: :!! :!! !!: :!! !!: !!: !!! !!: !!!
- :!: !:! :!: !:! :!: !:: :!: !:: :!: !:! :!: !:!
- :: ::: :: ::: ::: :::: ::: :::: :: ::: :: :::
- : : : : : : :: :: : :: :: : : : : : : :
- */
- ?>
Add Comment
Please, Sign In to add comment