function comment_exists($comment_author, $comment_date) {
global $wpdb;
- $comment_author = stripslashes($comment_author);
- $comment_date = stripslashes($comment_date);
-
return $wpdb->get_var( $wpdb->prepare("SELECT comment_post_ID FROM $wpdb->comments
- WHERE comment_author = %s AND comment_date = %s", $comment_author, $comment_date) );
+ WHERE comment_author = %s AND comment_date = %s",
+ stripslashes( $comment_author ),
+ stripslashes( $comment_date )
+ ) );
}
/**
* @since 2.0.0
*/
function edit_comment() {
-
if ( ! current_user_can( 'edit_comment', (int) $_POST['comment_ID'] ) )
wp_die ( __( 'You are not allowed to edit comments on this post.' ) );
* @since 2.0.0
*
* @param int $id ID of comment to retrieve.
- * @return bool|object Comment if found. False on failure.
+ * @return object|false Comment if found. False on failure.
*/
function get_comment_to_edit( $id ) {
if ( !$comment = get_comment($id) )
* Add avatars to relevant places in admin, or try to.
*
* @since 2.5.0
- * @uses $comment
+ *
+ * @global object $comment
*
* @param string $name User name.
* @return string Avatar with Admin name.
return "$avatar $name";
}
+/**
+ * @since 2.7.0
+ */
function enqueue_comment_hotkeys_js() {
if ( 'true' == get_user_option( 'comment_shortcuts' ) )
wp_enqueue_script( 'jquery-table-hotkeys' );