[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-admin/includes/ -> comment.php (summary)

WordPress Comment Administration API.

File Size: 219 lines (6 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 1 file
 wp-admin/admin-footer.php

Defines 7 functions

  comment_exists()
  edit_comment()
  get_comment_to_edit()
  get_pending_comments_num()
  floated_admin_avatar()
  enqueue_comment_hotkeys_js()
  comment_footer_die()

Functions
Functions that are not part of a class:

comment_exists( $comment_author, $comment_date, $timezone = 'blog' )   X-Ref
Determines if a comment exists based on author and date.

For best performance, use `$timezone = 'gmt'`, which queries a field that is properly indexed. The default value
for `$timezone` is 'blog' for legacy reasons.

param: string $comment_author Author of the comment.
param: string $comment_date   Date of the comment.
param: string $timezone       Timezone. Accepts 'blog' or 'gmt'. Default 'blog'.
return: string|null Comment post ID on success.

edit_comment()   X-Ref
Updates a comment with values provided in $_POST.

return: int|WP_Error The value 1 if the comment was updated, 0 if not updated.

get_comment_to_edit( $id )   X-Ref
Returns a WP_Comment object based on comment ID.

param: int $id ID of comment to retrieve.
return: WP_Comment|false Comment if found. False on failure.

get_pending_comments_num( $post_id )   X-Ref
Gets the number of pending comments on a post or posts.

param: int|int[] $post_id Either a single Post ID or an array of Post IDs
return: int|int[] Either a single Posts pending comments as an int or an array of ints keyed on the Post IDs

floated_admin_avatar( $name )   X-Ref
Adds avatars to relevant places in admin.

param: string $name User name.
return: string Avatar with the user name.

enqueue_comment_hotkeys_js()   X-Ref
Enqueues comment shortcuts jQuery script.


comment_footer_die( $msg )   X-Ref
Displays error message at bottom of comments.

param: string $msg Error Message. Assumed to contain HTML and be sanitized.



Generated : Mon Mar 18 08:20:01 2024 Cross-referenced by PHPXref