Changeset 55308 for trunk/src/wp-includes/comment.php
- Timestamp:
- 02/12/2023 06:06:33 PM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment.php
r55258 r55308 1040 1040 * @global wpdb $wpdb WordPress database abstraction object. 1041 1041 * 1042 * @param int $comment_ IDComment ID.1042 * @param int $comment_id Comment ID. 1043 1043 * @param array $args { 1044 1044 * Array of optional arguments. … … 1050 1050 * Defaults to the value of the 'comments_per_page' option. 1051 1051 * @type int|string $max_depth If greater than 1, comment page will be determined 1052 * for the top-level parent `$comment_ ID`.1052 * for the top-level parent `$comment_id`. 1053 1053 * Defaults to the value of the 'thread_comments_depth' option. 1054 1054 * } * 1055 1055 * @return int|null Comment page number or null on error. 1056 1056 */ 1057 function get_page_of_comment( $comment_ ID, $args = array() ) {1057 function get_page_of_comment( $comment_id, $args = array() ) { 1058 1058 global $wpdb; 1059 1059 1060 1060 $page = null; 1061 1061 1062 $comment = get_comment( $comment_ ID);1062 $comment = get_comment( $comment_id ); 1063 1063 if ( ! $comment ) { 1064 1064 return; … … 1176 1176 * 1177 1177 * @since 4.4.0 1178 * @since 4.7.0 Introduced the `$comment_ ID` parameter.1178 * @since 4.7.0 Introduced the `$comment_id` parameter. 1179 1179 * 1180 1180 * @param int $page Comment page. … … 1197 1197 * @type int $max_depth Maximum comment threading depth allowed. 1198 1198 * } 1199 * @param int $comment_ IDID of the comment.1200 */ 1201 return apply_filters( 'get_page_of_comment', (int) $page, $args, $original_args, $comment_ ID);1199 * @param int $comment_id ID of the comment. 1200 */ 1201 return apply_filters( 'get_page_of_comment', (int) $page, $args, $original_args, $comment_id ); 1202 1202 } 1203 1203 … … 1838 1838 * @since 2.7.0 1839 1839 * 1840 * @param string $comment_ IDThe comment ID as a numeric string.1840 * @param string $comment_id The comment ID as a numeric string. 1841 1841 * @param WP_Comment $comment Comment object. 1842 1842 */ … … 2282 2282 } 2283 2283 2284 $comment_ ID= wp_insert_comment( $commentdata );2285 2286 if ( ! $comment_ ID) {2284 $comment_id = wp_insert_comment( $commentdata ); 2285 2286 if ( ! $comment_id ) { 2287 2287 $fields = array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content' ); 2288 2288 … … 2300 2300 } 2301 2301 2302 $comment_ ID= wp_insert_comment( $commentdata );2303 if ( ! $comment_ ID) {2302 $comment_id = wp_insert_comment( $commentdata ); 2303 if ( ! $comment_id ) { 2304 2304 return false; 2305 2305 } … … 2312 2312 * @since 4.5.0 The `$commentdata` parameter was added. 2313 2313 * 2314 * @param int $comment_ IDThe comment ID.2314 * @param int $comment_id The comment ID. 2315 2315 * @param int|string $comment_approved 1 if the comment is approved, 0 if not, 'spam' if spam. 2316 2316 * @param array $commentdata Comment data. 2317 2317 */ 2318 do_action( 'comment_post', $comment_ ID, $commentdata['comment_approved'], $commentdata );2319 2320 return $comment_ ID;2318 do_action( 'comment_post', $comment_id, $commentdata['comment_approved'], $commentdata ); 2319 2320 return $comment_id; 2321 2321 } 2322 2322 … … 2326 2326 * @since 4.4.0 2327 2327 * 2328 * @param int $comment_ IDID of the comment.2328 * @param int $comment_id ID of the comment. 2329 2329 * @return bool True on success, false on failure. 2330 2330 */ 2331 function wp_new_comment_notify_moderator( $comment_ ID) {2332 $comment = get_comment( $comment_ ID);2331 function wp_new_comment_notify_moderator( $comment_id ) { 2332 $comment = get_comment( $comment_id ); 2333 2333 2334 2334 // Only send notifications for pending comments. … … 2336 2336 2337 2337 /** This filter is documented in wp-includes/comment.php */ 2338 $maybe_notify = apply_filters( 'notify_moderator', $maybe_notify, $comment_ ID);2338 $maybe_notify = apply_filters( 'notify_moderator', $maybe_notify, $comment_id ); 2339 2339 2340 2340 if ( ! $maybe_notify ) { … … 2342 2342 } 2343 2343 2344 return wp_notify_moderator( $comment_ ID);2344 return wp_notify_moderator( $comment_id ); 2345 2345 } 2346 2346 … … 2353 2353 * should be notified when a new comment is added, overriding site setting. 2354 2354 * 2355 * @param int $comment_ IDComment ID.2355 * @param int $comment_id Comment ID. 2356 2356 * @return bool True on success, false on failure. 2357 2357 */ 2358 function wp_new_comment_notify_postauthor( $comment_ ID) {2359 $comment = get_comment( $comment_ ID);2358 function wp_new_comment_notify_postauthor( $comment_id ) { 2359 $comment = get_comment( $comment_id ); 2360 2360 2361 2361 $maybe_notify = get_option( 'comments_notify' ); … … 2368 2368 * 2369 2369 * @param bool $maybe_notify Whether to notify the post author about the new comment. 2370 * @param int $comment_ IDThe ID of the comment for the notification.2371 */ 2372 $maybe_notify = apply_filters( 'notify_post_author', $maybe_notify, $comment_ ID);2370 * @param int $comment_id The ID of the comment for the notification. 2371 */ 2372 $maybe_notify = apply_filters( 'notify_post_author', $maybe_notify, $comment_id ); 2373 2373 2374 2374 /* … … 2385 2385 } 2386 2386 2387 return wp_notify_postauthor( $comment_ ID);2387 return wp_notify_postauthor( $comment_id ); 2388 2388 } 2389 2389
Note: See TracChangeset
for help on using the changeset viewer.