Changeset 8091
- Timestamp:
- 06/15/2008 09:34:00 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/comment.php
r8052 r8091 7 7 8 8 /** 9 * check_comment() - Checks whether a comment passes internal checks to be allowed to add 10 * 11 * {@internal Missing Long Description}} 9 * Checks whether a comment passes internal checks to be allowed to add. 10 * 11 * If comment moderation is set in the administration, then all comments, 12 * regardless of their type and whitelist will be set to false. 13 * 14 * If the number of links exceeds the amount in the administration, then the 15 * check fails. 16 * 17 * If any of the parameter contents match the blacklist of words, then the check 18 * fails. 19 * 20 * If the comment is a trackback and part of the blogroll, then the trackback is 21 * automatically whitelisted. If the comment author was approved before, then 22 * the comment is automatically whitelisted. 23 * 24 * If none of the checks fail, then the failback is to set the check to pass 25 * (return true). 12 26 * 13 27 * @since 1.2 14 28 * @uses $wpdb 15 29 * 16 * @param string $author {@internal Missing Description }} 17 * @param string $email {@internal Missing Description }} 18 * @param string $url {@internal Missing Description }} 19 * @param string $comment {@internal Missing Description }} 20 * @param string $user_ip {@internal Missing Description }} 21 * @param string $user_agent {@internal Missing Description }} 22 * @param string $comment_type {@internal Missing Description }} 23 * @return bool {@internal Missing Description }} 30 * @param string $author Comment Author's name 31 * @param string $email Comment Author's email 32 * @param string $url Comment Author's URL 33 * @param string $comment Comment contents 34 * @param string $user_ip Comment Author's IP address 35 * @param string $user_agent Comment Author's User Agent 36 * @param string $comment_type Comment type, either user submitted comment, 37 * trackback, or pingback 38 * @return bool Whether the checks passed (true) and the comments should be 39 * displayed or set to moderated 24 40 */ 25 41 function check_comment($author, $email, $url, $comment, $user_ip, $user_agent, $comment_type) { … … 84 100 85 101 /** 86 * get_approved_comments() - Returns the approved comments for post $post_id102 * Retrieve the approved comments for post $post_id. 87 103 * 88 104 * @since 2.0 … … 98 114 99 115 /** 100 * get_comment() - Retrieves comment data given a comment ID or comment object. 101 * 102 * {@internal Missing Long Description}} 116 * Retrieves comment data given a comment ID or comment object. 117 * 118 * If an object is passed then the comment data will be cached and then returned 119 * after being passed through a filter. 120 * 121 * If the comment is empty, then the global comment variable will be used, if it 122 * is set. 103 123 * 104 124 * @since 2.0 105 125 * @uses $wpdb 106 126 * 107 * @param object|string|int $comment {@internal Missing Description}}108 * @param string $output O BJECT or ARRAY_A or ARRAY_N constants127 * @param object|string|int $comment Comment to retrieve. 128 * @param string $output Optional. OBJECT or ARRAY_A or ARRAY_N constants 109 129 * @return object|array|null Depends on $output value. 110 130 */ … … 143 163 144 164 /** 145 * get_commentdata() - Returns an array of comment data about comment $comment_ID146 * 147 * get_comment() technically does the same thing as this function. This function also148 * a ppears to reference variables and then not use them or not update them when needed.149 * It is advised to switch to get_comment(), since this function might be deprecated in150 * favor of using get_comment().165 * Retrieve an array of comment data about comment $comment_ID. 166 * 167 * get_comment() technically does the same thing as this function. This function 168 * also appears to reference variables and then not use them or not update them 169 * when needed. It is advised to switch to get_comment(), since this function 170 * might be deprecated in favor of using get_comment(). 151 171 * 152 172 * @deprecated Use get_comment() … … 163 183 * @return array The comment data 164 184 */ 165 function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) { // less flexible, but saves DB queries185 function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) { 166 186 global $postc, $wpdb; 167 187 if ( $no_cache ) { … … 187 207 188 208 /** 189 * get_lastcommentmodified() - The date the last comment was modified209 * The date the last comment was modified. 190 210 * 191 211 * {@internal Missing Long Description}} … … 195 215 * @global array $cache_lastcommentmodified 196 216 * 197 * @param string $timezone Which timezone to use in reference to 'gmt', 'blog', or 'server' locations 217 * @param string $timezone Which timezone to use in reference to 'gmt', 'blog', 218 * or 'server' locations 198 219 * @return string Last comment modified date 199 220 */ … … 224 245 225 246 /** 226 * get_comment_count() - The amount of comments in a post or total comments247 * The amount of comments in a post or total comments. 227 248 * 228 249 * {@internal Missing Long Description}} … … 231 252 * @uses $wpdb 232 253 * 233 * @param int $post_id Optional. Comment amount in post if > 0, else total com 234 ments blog wide 254 * @param int $post_id Optional. Comment amount in post if > 0, else total comments blog wide 235 255 * @return array The amount of spam, approved, awaiting moderation, and total 236 256 */ … … 282 302 283 303 /** 284 * sanitize_comment_cookies() - {@internal Missing Short Description}} 285 * 286 * {@internal Missing Long Description}} 304 * Sanitizes the cookies sent to the user already. 305 * 306 * Will only do anything if the cookies have already been created for the user. 307 * Mostly used after cookies had been sent to use elsewhere. 287 308 * 288 309 * @since 2.0.4 289 *290 310 */ 291 311 function sanitize_comment_cookies() { … … 312 332 313 333 /** 314 * wp_allow_comment() - Validates whether this comment is allowed to be made or not334 * Validates whether this comment is allowed to be made or not. 315 335 * 316 336 * {@internal Missing Long Description}} … … 363 383 364 384 /** 365 * check_comment_flood_db() -{@internal Missing Short Description}}385 * {@internal Missing Short Description}} 366 386 * 367 387 * {@internal Missing Long Description}} … … 392 412 393 413 /** 394 * wp_blacklist_check() - Does comment contain blacklisted characters or words414 * Does comment contain blacklisted characters or words. 395 415 * 396 416 * {@internal Missing Long Description}} … … 449 469 } 450 470 471 /** 472 * {@internal Missing Short Description}} 473 * 474 * {@internal Missing Long Description}} 475 * 476 * @param unknown_type $post_id 477 * @return unknown 478 */ 451 479 function wp_count_comments( $post_id = 0 ) { 452 480 global $wpdb; … … 486 514 487 515 /** 488 * wp_delete_comment() - Removes comment ID and maybe updates post comment count489 * 490 * The post comment count will be updated if the comment was approved and has a post491 * ID available.516 * Removes comment ID and maybe updates post comment count. 517 * 518 * The post comment count will be updated if the comment was approved and has a 519 * post ID available. 492 520 * 493 521 * @since 2.0.0 … … 519 547 520 548 /** 521 * wp_get_comment_status() - The status of a comment by ID549 * The status of a comment by ID. 522 550 * 523 551 * @since 1.0.0 … … 546 574 547 575 /** 548 * wp_get_current_commenter() - Get current commenter's name, email, and URL576 * Get current commenter's name, email, and URL. 549 577 * 550 578 * Expects cookies content to already be sanitized. User of this function … … 576 604 577 605 /** 578 * wp_insert_comment() - Inserts a comment to the database606 * Inserts a comment to the database. 579 607 * 580 608 * {@internal Missing Long Description}} … … 617 645 618 646 /** 619 * wp_filter_comment() - Parses and returns comment information620 * 621 * Sets the comment data 'filtered' field to true when finished. This 622 * c an be checked as to whether the comment should be filtered and to623 * keep fromfiltering the same comment more than once.647 * Parses and returns comment information. 648 * 649 * Sets the comment data 'filtered' field to true when finished. This can be 650 * checked as to whether the comment should be filtered and to keep from 651 * filtering the same comment more than once. 624 652 * 625 653 * @since 2.0.0 … … 648 676 649 677 /** 650 * wp_throttle_comment_flood() -{@internal Missing Short Description}}678 * {@internal Missing Short Description}} 651 679 * 652 680 * {@internal Missing Long Description}} … … 668 696 669 697 /** 670 * wp_new_comment() - Parses and adds a new comment to the database698 * Parses and adds a new comment to the database. 671 699 * 672 700 * {@internal Missing Long Description}} … … 716 744 717 745 /** 718 * wp_set_comment_status() - Sets the status of comment ID746 * Sets the status of comment ID. 719 747 * 720 748 * {@internal Missing Long Description}} … … 763 791 764 792 /** 765 * wp_update_comment() - Parses and updates an existing comment in the database793 * Parses and updates an existing comment in the database. 766 794 * 767 795 * {@internal Missing Long Description}} … … 822 850 823 851 /** 824 * wp_defer_comment_counting() - Whether to defer comment counting852 * Whether to defer comment counting. 825 853 * 826 854 * When setting $defer to true, all post comment counts will not be updated … … 849 877 850 878 /** 851 * wp_update_comment_count() - Updates the comment count for post(s)852 * 853 * When $do_deferred is false (is by default) and the comments have been 854 * set to be deferred, the post_id will be added to a queue, which will855 * be updated at alater date and only updated once per post ID.856 * 857 * If the comments have not be set up to be deferred, then the post will 858 * be updated. When $do_deferred is set to true, then all previous deferred859 * postIDs will be updated along with the current $post_id.879 * Updates the comment count for post(s). 880 * 881 * When $do_deferred is false (is by default) and the comments have been set to 882 * be deferred, the post_id will be added to a queue, which will be updated at a 883 * later date and only updated once per post ID. 884 * 885 * If the comments have not be set up to be deferred, then the post will be 886 * updated. When $do_deferred is set to true, then all previous deferred post 887 * IDs will be updated along with the current $post_id. 860 888 * 861 889 * @since 2.1.0 … … 888 916 889 917 /** 890 * wp_update_comment_count_now() - Updates the comment count for the post918 * Updates the comment count for the post. 891 919 * 892 920 * @since 2.5 … … 926 954 927 955 /** 928 * discover_pingback_server_uri() - Finds a pingback server URI based on the given URL956 * Finds a pingback server URI based on the given URL. 929 957 * 930 958 * {@internal Missing Long Description}} … … 1022 1050 1023 1051 /** 1024 * do_all_pings() -{@internal Missing Short Description}}1052 * {@internal Missing Short Description}} 1025 1053 * 1026 1054 * {@internal Missing Long Description}} … … 1055 1083 1056 1084 /** 1057 * do_trackbacks() -{@internal Missing Short Description}}1085 * {@internal Missing Short Description}} 1058 1086 * 1059 1087 * {@internal Missing Long Description}} … … 1099 1127 1100 1128 /** 1101 * generic_ping() -{@internal Missing Short Description}}1129 * {@internal Missing Short Description}} 1102 1130 * 1103 1131 * {@internal Missing Long Description}} … … 1122 1150 1123 1151 /** 1124 * pingback() - Pings back the links found in a post1152 * Pings back the links found in a post. 1125 1153 * 1126 1154 * {@internal Missing Long Description}} … … 1199 1227 1200 1228 /** 1201 * privacy_ping_filter() -{@internal Missing Short Description}}1229 * {@internal Missing Short Description}} 1202 1230 * 1203 1231 * {@internal Missing Long Description}} … … 1216 1244 1217 1245 /** 1218 * trackback() - Send a Trackback1219 * 1220 * {@internal Missing Long Description}}1246 * Send a Trackback. 1247 * 1248 * Updates database when sending trackback to prevent duplicates. 1221 1249 * 1222 1250 * @since 0.71 … … 1224 1252 * @uses $wp_version WordPress version 1225 1253 * 1226 * @param string $trackback_url {@internal Missing Description}}1227 * @param string $title {@internal Missing Description}}1228 * @param string $excerpt {@internal Missing Description}}1229 * @param int $ID {@internal Missing Description}}1230 * @return unknown {@internal Missing Description}}1254 * @param string $trackback_url URL to send trackbacks. 1255 * @param string $title Title of post 1256 * @param string $excerpt Excerpt of post 1257 * @param int $ID Post ID 1258 * @return mixed Database query from update 1231 1259 */ 1232 1260 function trackback($trackback_url, $title, $excerpt, $ID) { … … 1262 1290 1263 1291 /** 1264 * weblog_ping() - {@internal Missing Short Description}} 1265 * 1266 * {@internal Missing Long Description}} 1292 * Send a pingback. 1267 1293 * 1268 1294 * @since 1.2.0 … … 1270 1296 * @uses IXR_Client 1271 1297 * 1272 * @param unknown_type $server1273 * @param unknown_type $path1298 * @param string $server Host of blog to connect to. 1299 * @param string $path Path to send the ping. 1274 1300 */ 1275 1301 function weblog_ping($server = '', $path = '') { … … 1294 1320 1295 1321 /** 1296 * clean_comment_cache() - Removes comment ID from the comment cache1322 * Removes comment ID from the comment cache. 1297 1323 * 1298 1324 * @since 2.3.0 … … 1307 1333 1308 1334 /** 1309 * update_comment_cache() - Updates the comment cache of given comments1335 * Updates the comment cache of given comments. 1310 1336 * 1311 1337 * Will add the comments in $comments to the cache. If comment ID already
Note: See TracChangeset
for help on using the changeset viewer.