Changeset 8949
- Timestamp:
- 09/22/2008 03:39:41 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/comment.php
r8897 r8949 11 11 * 12 12 * If comment moderation is set in the administration, then all comments, 13 * regardless of their type and whitelist will be set to false. 14 * 15 * If the number of links exceeds the amount in the administration, then the 16 * check fails. 17 * 18 * If any of the parameter contents match the blacklist of words, then the check 19 * fails. 13 * regardless of their type and whitelist will be set to false. If the number of 14 * links exceeds the amount in the administration, then the check fails. If any 15 * of the parameter contents match the blacklist of words, then the check fails. 20 16 * 21 17 * If the comment is a trackback and part of the blogroll, then the trackback is … … 26 22 * (return true). 27 23 * 28 * @since 1.2 24 * @since 1.2.0 29 25 * @uses $wpdb 30 26 * … … 103 99 * Retrieve the approved comments for post $post_id. 104 100 * 105 * @since 2.0 101 * @since 2.0.0 106 102 * @uses $wpdb 107 103 * … … 118 114 * 119 115 * If an object is passed then the comment data will be cached and then returned 120 * after being passed through a filter. 121 * 122 * If the comment is empty, then the global comment variable will be used, if it 123 * is set. 124 * 125 * @since 2.0 116 * after being passed through a filter. If the comment is empty, then the global 117 * comment variable will be used, if it is set. 118 * 119 * @since 2.0.0 126 120 * @uses $wpdb 127 121 * 128 122 * @param object|string|int $comment Comment to retrieve. 129 * @param string $output Optional. OBJECT or ARRAY_A or ARRAY_N constants 123 * @param string $output Optional. OBJECT or ARRAY_A or ARRAY_N constants. 130 124 * @return object|array|null Depends on $output value. 131 125 */ … … 164 158 165 159 /** 166 * Retrieve a list of comments 167 * 168 * {@internal Missing Long Description}} 169 * 170 * @package WordPress 171 * @subpackage Comment 172 * @since 2.7 160 * Retrieve a list of comments. 161 * 162 * The list of comment arguments are 'status', 'orderby', 'comment_date_gmt', 163 * 'order', 'number', 'offset', and 'post_id'. 164 * 165 * @since 2.7.0 173 166 * @uses $wpdb 174 167 * 175 * @param mixed $args Optional. Array or string of options 176 * @return array List of comments matching defaults or $args168 * @param mixed $args Optional. Array or string of options to override defaults. 169 * @return array List of comments. 177 170 */ 178 171 function get_comments( $args = '' ) { … … 224 217 * Retrieve all of the WordPress supported comment statuses. 225 218 * 226 * Comments have a limited set of valid status values, this provides the 227 * commentstatus values and descriptions.219 * Comments have a limited set of valid status values, this provides the comment 220 * status values and descriptions. 228 221 * 229 222 * @package WordPress 230 223 * @subpackage Post 231 * @since 2.7 224 * @since 2.7.0 232 225 * 233 226 * @return array List of comment statuses. … … 247 240 * The date the last comment was modified. 248 241 * 249 * {@internal Missing Long Description}}250 *251 242 * @since 1.5.0 252 243 * @uses $wpdb … … 254 245 * 255 246 * @param string $timezone Which timezone to use in reference to 'gmt', 'blog', 256 * or 'server' locations 257 * @return string Last comment modified date 247 * or 'server' locations. 248 * @return string Last comment modified date. 258 249 */ 259 250 function get_lastcommentmodified($timezone = 'server') { … … 285 276 * The amount of comments in a post or total comments. 286 277 * 287 * {@internal Missing Long Description}} 278 * A lot like {@link wp_count_comments()}, in that they both return comment 279 * stats (albeit with different types). The {@link wp_count_comments()} actual 280 * caches, but this function does not. 288 281 * 289 282 * @since 2.0.0 290 283 * @uses $wpdb 291 284 * 292 * @param int $post_id Optional. Comment amount in post if > 0, else total comments blog wide 293 * @return array The amount of spam, approved, awaiting moderation, and total 285 * @param int $post_id Optional. Comment amount in post if > 0, else total comments blog wide. 286 * @return array The amount of spam, approved, awaiting moderation, and total comments. 294 287 */ 295 288 function get_comment_count( $post_id = 0 ) { … … 372 365 * Validates whether this comment is allowed to be made or not. 373 366 * 374 * {@internal Missing Long Description}}375 *376 367 * @since 2.0.0 377 368 * @uses $wpdb … … 425 416 426 417 /** 427 * {@internal Missing Short Description}} 428 * 429 * {@internal Missing Long Description}} 418 * Check whether comment flooding is occurring. 419 * 420 * Won't run, if current user can manage options, so to not block 421 * administrators. 430 422 * 431 423 * @since 2.3.0 432 424 * @uses $wpdb 433 * @uses apply_filters() {@internal Missing Description}} 434 * @uses do_action() {@internal Missing Description}} 435 * 436 * @param string $ip {@internal Missing Description}} 437 * @param string $email {@internal Missing Description}} 438 * @param unknown_type $date {@internal Missing Description}} 425 * @uses apply_filters() Calls 'comment_flood_filter' filter with first 426 * parameter false, last comment timestamp, new comment timestamp. 427 * @uses do_action() Calls 'comment_flood_trigger' action with parameters with 428 * last comment timestamp and new comment timestamp. 429 * 430 * @param string $ip Comment IP. 431 * @param string $email Comment author email address. 432 * @param string $date MySQL time string. 439 433 */ 440 434 function check_comment_flood_db( $ip, $email, $date ) { … … 460 454 * Separates an array of comments into an array keyed by comment_type. 461 455 * 462 * @since 2.7 456 * @since 2.7.0 463 457 * 464 458 * @param array $comments Array of comments … … 481 475 * Does comment contain blacklisted characters or words. 482 476 * 483 * {@internal Missing Long Description}}484 *485 477 * @since 1.5.0 486 * @uses do_action() Calls 'wp_blacklist_check' hook for all parameters 478 * @uses do_action() Calls 'wp_blacklist_check' hook for all parameters. 487 479 * 488 480 * @param string $author The author of the comment … … 537 529 538 530 /** 539 * {@internal Missing Short Description}} 540 * 541 * {@internal Missing Long Description}} 542 * 543 * @param unknown_type $post_id 544 * @return unknown 531 * Retrieve total comments for blog or single post. 532 * 533 * The properties of the returned object contain the 'moderated', 'approved', 534 * and spam comments for either the entire blog or single post. Those properties 535 * contain the amount of comments that match the status. The 'total_comments' 536 * property contains the integer of total comments. 537 * 538 * The comment stats are cached and then retrieved, if they already exist in the 539 * cache. 540 * 541 * @since 2.5.0 542 * 543 * @param int $post_id Optional. Post ID. 544 * @return object Comment stats. 545 545 */ 546 546 function wp_count_comments( $post_id = 0 ) { … … 619 619 * 620 620 * @param int $comment_id Comment ID 621 * @return string|bool Status might be 'deleted', 'approved', 'unapproved', 'spam'. False on failure 621 * @return string|bool Status might be 'deleted', 'approved', 'unapproved', 'spam'. False on failure. 622 622 */ 623 623 function wp_get_comment_status($comment_id) { … … 643 643 * Get current commenter's name, email, and URL. 644 644 * 645 * Expects cookies content to already be sanitized. User of this function 646 * mightwish to recheck the returned array for validity.645 * Expects cookies content to already be sanitized. User of this function might 646 * wish to recheck the returned array for validity. 647 647 * 648 648 * @see sanitize_comment_cookies() Use to sanitize cookies … … 650 650 * @since 2.0.4 651 651 * 652 * @return array Comment author, email, url respectively 652 * @return array Comment author, email, url respectively. 653 653 */ 654 654 function wp_get_current_commenter() { … … 673 673 * Inserts a comment to the database. 674 674 * 675 * {@internal Missing Long Description}} 675 * The available comment data key names are 'comment_author_IP', 'comment_date', 676 * 'comment_date_gmt', 'comment_parent', 'comment_approved', and 'user_id'. 676 677 * 677 678 * @since 2.0.0 678 679 * @uses $wpdb 679 680 * 680 * @param array $commentdata Contains information on the comment 681 * @return int The new comment's id681 * @param array $commentdata Contains information on the comment. 682 * @return int The new comment's ID. 682 683 */ 683 684 function wp_insert_comment($commentdata) { … … 712 713 713 714 /** 714 * Parses and returns comment information.715 * Filters and sanitizes comment data. 715 716 * 716 717 * Sets the comment data 'filtered' field to true when finished. This can be … … 743 744 744 745 /** 745 * {@internal Missing Short Description}} 746 * 747 * {@internal Missing Long Description}} 746 * Whether comment should be blocked because of comment flood. 748 747 * 749 748 * @since 2.1.0 750 749 * 751 * @param unknown_type $block {@internal Missing Description}}752 * @param unknown_type $time_lastcomment {@internal Missing Description}}753 * @param unknown_type $time_newcomment {@internal Missing Description}}754 * @return unknown {@internal Missing Description}}750 * @param bool $block Whether plugin has already blocked comment. 751 * @param int $time_lastcomment Timestamp for last comment. 752 * @param int $time_newcomment Timestamp for new comment. 753 * @return bool Whether comment should be blocked. 755 754 */ 756 755 function wp_throttle_comment_flood($block, $time_lastcomment, $time_newcomment) { … … 763 762 764 763 /** 765 * Parses and adds a new comment to the database. 766 * 767 * {@internal Missing Long Description}} 764 * Adds a new comment to the database. 765 * 766 * Filters new comment to ensure that the fields are sanitized and valid before 767 * inserting comment into database. Calls 'comment_post' action with comment ID 768 * and whether comment is approved by WordPress. Also has 'preprocess_comment' 769 * filter for processing the comment data before the function handles it. 768 770 * 769 771 * @since 1.5.0 770 772 * @uses apply_filters() Calls 'preprocess_comment' hook on $commentdata parameter array before processing 771 773 * @uses do_action() Calls 'comment_post' hook on $comment_ID returned from adding the comment and if the comment was approved. 772 * @uses wp_filter_comment() Used to filter comment before adding comment 774 * @uses wp_filter_comment() Used to filter comment before adding comment. 773 775 * @uses wp_allow_comment() checks to see if comment is approved. 774 * @uses wp_insert_comment() Does the actual comment insertion to the database 776 * @uses wp_insert_comment() Does the actual comment insertion to the database. 775 777 * 776 778 * @param array $commentdata Contains information on the comment … … 815 817 816 818 /** 817 * Sets the status of comment ID. 818 * 819 * {@internal Missing Long Description}} 819 * Sets the status of a comment. 820 * 821 * The 'wp_set_comment_status' action is called after the comment is handled and 822 * will only be called, if the comment status is either 'hold', 'approve', or 823 * 'spam'. If the comment status is not in the list, then false is returned and 824 * if the status is 'delete', then the comment is deleted without calling the 825 * action. 820 826 * 821 827 * @since 1.0.0 822 828 * 823 * @param int $comment_id Comment ID 824 * @param string $comment_status New comment status, either 'hold', 'approve', 'spam', or 'delete' 829 * @param int $comment_id Comment ID. 830 * @param string $comment_status New comment status, either 'hold', 'approve', 'spam', or 'delete'. 825 831 * @return bool False on failure or deletion and true on success. 826 832 */ … … 862 868 863 869 /** 864 * Parses and updates an existing comment in the database.865 * 866 * {@internal Missing Long Description}}870 * Updates an existing comment in the database. 871 * 872 * Filters the comment and makes sure certain fields are valid before updating. 867 873 * 868 874 * @since 2.0.0 869 875 * @uses $wpdb 870 876 * 871 * @param array $commentarr Contains information on the comment 877 * @param array $commentarr Contains information on the comment. 872 878 * @return int Comment was updated if value is 1, or was not updated if value is 0. 873 879 */ … … 935 941 * updated without having to call wp_update_comment_count() after. 936 942 * 937 * @since 2.5 943 * @since 2.5.0 938 944 * @staticvar bool $_defer 939 945 * … … 996 1002 * Updates the comment count for the post. 997 1003 * 998 * @since 2.5 1004 * @since 2.5.0 999 1005 * @uses $wpdb 1000 1006 * @uses do_action() Calls 'wp_update_comment_count' hook on $post_id, $new, and $old … … 1034 1040 * Finds a pingback server URI based on the given URL. 1035 1041 * 1036 * {@internal Missing Long Description}} 1042 * Checks the HTML for the rel="pingback" link and x-pingback headers. It does 1043 * a check for the x-pingback headers first and returns that, if available. The 1044 * check for the rel="pingback" has more overhead than just the header. 1037 1045 * 1038 1046 * @since 1.5.0 1039 1047 * @uses $wp_version 1040 1048 * 1041 * @param string $url URL to ping 1049 * @param string $url URL to ping. 1042 1050 * @param int $timeout_bytes Number of bytes to timeout at. Prevents big file downloads, default is 2048. 1043 1051 * @return bool|string False on failure, string containing URI on success. … … 1128 1136 1129 1137 /** 1130 * {@internal Missing Short Description}} 1131 * 1132 * {@internal Missing Long Description}} 1138 * Perform all pingbacks, enclosures, trackbacks, and send to pingback services. 1133 1139 * 1134 1140 * @since 2.1.0 … … 1161 1167 1162 1168 /** 1163 * {@internal Missing Short Description}} 1164 * 1165 * {@internal Missing Long Description}} 1169 * Perform trackbacks. 1166 1170 * 1167 1171 * @since 1.5.0 1168 1172 * @uses $wpdb 1169 1173 * 1170 * @param int $post_id Post ID to do trackbacks on 1174 * @param int $post_id Post ID to do trackbacks on. 1171 1175 */ 1172 1176 function do_trackbacks($post_id) { … … 1205 1209 1206 1210 /** 1207 * {@internal Missing Short Description}} 1208 * 1209 * {@internal Missing Long Description}} 1211 * Sends pings to all of the ping site services. 1210 1212 * 1211 1213 * @since 1.2.0 … … 1230 1232 * Pings back the links found in a post. 1231 1233 * 1232 * {@internal Missing Long Description}}1233 *1234 1234 * @since 0.71 1235 1235 * @uses $wp_version 1236 1236 * @uses IXR_Client 1237 1237 * 1238 * @param string $content {@internal Missing Description}}1239 * @param int $post_ID {@internal Missing Description}}1238 * @param string $content Post content to check for links. 1239 * @param int $post_ID Post ID. 1240 1240 */ 1241 1241 function pingback($content, $post_ID) { … … 1305 1305 1306 1306 /** 1307 * {@internal Missing Short Description}} 1308 * 1309 * {@internal Missing Long Description}} 1307 * Check whether blog is public before returning sites. 1310 1308 * 1311 1309 * @since 2.1.0 1312 1310 * 1313 * @param unknown_type $sites {@internal Missing Description}}1314 * @return unknown {@internal Missing Description}}1311 * @param mixed $sites Will return if blog is public, will not return if not public. 1312 * @return mixed Empty string if blog is not public, returns $sites, if site is public. 1315 1313 */ 1316 1314 function privacy_ping_filter($sites) { … … 1331 1329 * 1332 1330 * @param string $trackback_url URL to send trackbacks. 1333 * @param string $title Title of post 1334 * @param string $excerpt Excerpt of post 1335 * @param int $ID Post ID 1336 * @return mixed Database query from update 1331 * @param string $title Title of post. 1332 * @param string $excerpt Excerpt of post. 1333 * @param int $ID Post ID. 1334 * @return mixed Database query from update. 1337 1335 */ 1338 1336 function trackback($trackback_url, $title, $excerpt, $ID) { … … 1413 1411 * Updates the comment cache of given comments. 1414 1412 * 1415 * Will add the comments in $comments to the cache. If comment ID already 1416 * exists in the comment cache then it will not be updated. 1417 * 1418 * The comment is added to the cache using the comment group with the key 1419 * using the ID of the comments. 1413 * Will add the comments in $comments to the cache. If comment ID already exists 1414 * in the comment cache then it will not be updated. The comment is added to the 1415 * cache using the comment group with the key using the ID of the comments. 1420 1416 * 1421 1417 * @since 2.3.0 1418 * @package WordPress 1419 * @subpackage Cache 1422 1420 * 1423 1421 * @param array $comments Array of comment row objects … … 1435 1433 * Close comments on old posts on the fly, without any extra DB queries. 1436 1434 * 1437 * @since 2.7 1438 * @package WordPress 1439 * @subpackage Internal 1435 * @access private 1436 * @since 2.7.0 1437 * 1438 * @param object $posts Post data object. 1439 * @return object 1440 1440 */ 1441 1441 function _close_comments_for_old_posts( $posts ) {
Note: See TracChangeset
for help on using the changeset viewer.