Evengar

Untitled

Feb 3rd, 2017
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.31 KB | None | 0 0
  1.     function get_book_comment($book_id) {
  2.         global $wpdb;
  3.         $table_name = $wpdb->prefix . 'posts';
  4.         $query = "SELECT `post_content` FROM $table_name WHERE `ID` = $book_id;";
  5.         $result = $wpdb->get_results($query, ARRAY_N);
  6.         if (!empty($result)) {
  7.             return $result[0][0];
  8.         }
  9.         else {
  10.             return '';
  11.         }
  12.     }
Add Comment
Please, Sign In to add comment