Guest User

Untitled

a guest
May 22nd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. <?php
  2.  
  3. $comment_id = wp_new_comment( $commentdata );
  4.  
  5. $comment = get_comment($comment_id);
  6.  
  7. /*
  8. Another WordPress rant. Thursday, April 22nd, 2010
  9. ---------------------------------------------------------------------------
  10.  
  11. I found this beautiful bit of code on line 80 of wp-comments-post.php.
  12.  
  13. I dont't even think I need much explaining to do here.. but this is just
  14. another reason why this software is so effed up. Instead of instantiating
  15. a Comment class with the commentdata - or better - a new comment and adding
  16. the data a bit at a time, the wp_new_comment function is called from the
  17. *global* namespace.
  18.  
  19. Then you have to use a get_comment function to actually fetch the comment
  20. because instead of having the actual comment obj, you've only got the ID.
  21.  
  22. How many queries is this? How much of a fucking pain in the ass is it?
  23.  
  24. How hard is it for a developer, in their template, to echo $comment->body
  25. instead of a ridiculous the_comment() function inside of a "magical loop".
  26.  
  27.  
  28. @@@@@@ @@@@@@@ @@@@@@@@ @@@@@@@@ @@@ @@@ @@@ @@@
  29. @@@@@@@@ @@@@@@@@ @@@@@@@@@ @@@@@@@@@ @@@ @@@ @@@ @@@
  30. @@! @@@ @@! @@@ !@@ !@@ @@! @@@ @@! @@@
  31. !@! @!@ !@! @!@ !@! !@! !@! @!@ !@! @!@
  32. @!@!@!@! @!@!!@! !@! @!@!@ !@! @!@!@ @!@!@!@! @!@!@!@!
  33. !!!@!!!! !!@!@! !!! !!@!! !!! !!@!! !!!@!!!! !!!@!!!!
  34. !!: !!! !!: :!! :!! !!: :!! !!: !!: !!! !!: !!!
  35. :!: !:! :!: !:! :!: !:: :!: !:: :!: !:! :!: !:!
  36. :: ::: :: ::: ::: :::: ::: :::: :: ::: :: :::
  37. : : : : : : :: :: : :: :: : : : : : : :
  38.  
  39.  
  40. */
  41.  
  42. ?>
Add Comment
Please, Sign In to add comment