Created
April 23, 2010 04:54
-
-
Save whalesalad/376196 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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". | |
| @@@@@@ @@@@@@@ @@@@@@@@ @@@@@@@@ @@@ @@@ @@@ @@@ | |
| @@@@@@@@ @@@@@@@@ @@@@@@@@@ @@@@@@@@@ @@@ @@@ @@@ @@@ | |
| @@! @@@ @@! @@@ !@@ !@@ @@! @@@ @@! @@@ | |
| !@! @!@ !@! @!@ !@! !@! !@! @!@ !@! @!@ | |
| @!@!@!@! @!@!!@! !@! @!@!@ !@! @!@!@ @!@!@!@! @!@!@!@! | |
| !!!@!!!! !!@!@! !!! !!@!! !!! !!@!! !!!@!!!! !!!@!!!! | |
| !!: !!! !!: :!! :!! !!: :!! !!: !!: !!! !!: !!! | |
| :!: !:! :!: !:! :!: !:: :!: !:: :!: !:! :!: !:! | |
| :: ::: :: ::: ::: :::: ::: :::: :: ::: :: ::: | |
| : : : : : : :: :: : :: :: : : : : : : : | |
| */ | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment