get_comment_ID
Filters the returned comment ID.
Использование
add_filter( 'get_comment_ID', 'wp_kama_get_comment_ID_filter', 10, 2 );
/**
* Function for `get_comment_ID` filter-hook.
*
* @param string $comment_id The current comment ID as a numeric string.
* @param WP_Comment $comment The comment object.
*
* @return string
*/
function wp_kama_get_comment_ID_filter( $comment_id, $comment ){
// filter...
return $comment_id;
}
- $comment_id(строка)
- The current comment ID as a numeric string.
- $comment(WP_Comment)
- The comment object.
Список изменений
| С версии 1.5.0 | Введена. |
| С версии 4.1.0 | The $comment parameter was added. |
Где вызывается хук
get_comment_ID
wp-includes/comment-template.php 741
return apply_filters( 'get_comment_ID', $comment_id, $comment ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase