comment_max_links_url
Filter HookDescription
Filters the number of links found in a comment.Hook Information
File Location |
wp-includes/comment.php
View on GitHub
|
Hook Type | Filter |
Line Number | 65 |
Hook Parameters
Type | Name | Description |
---|---|---|
int
|
$num_links
|
The number of links found. |
string
|
$url
|
Comment author's URL. Included in allowed links total. |
string
|
$comment
|
Content of the comment. |
Usage Examples
Basic Usage
<?php
// Hook into comment_max_links_url
add_filter('comment_max_links_url', 'my_custom_filter', 10, 3);
function my_custom_filter($num_links, $url, $comment) {
// Your custom filtering logic here
return $num_links;
}
Source Code Context
wp-includes/comment.php:65
- How this hook is used in WordPress core
<?php
60 *
61 * @param int $num_links The number of links found.
62 * @param string $url Comment author's URL. Included in allowed links total.
63 * @param string $comment Content of the comment.
64 */
65 $num_links = apply_filters( 'comment_max_links_url', $num_links, $url, $comment );
66
67 /*
68 * If the number of links in the comment exceeds the allowed amount,
69 * fail the check by returning false.
70 */
PHP Documentation
<?php
/**
* Filters the number of links found in a comment.
*
* @since 3.0.0
* @since 4.7.0 Added the `$comment` parameter.
*
* @param int $num_links The number of links found.
* @param string $url Comment author's URL. Included in allowed links total.
* @param string $comment Content of the comment.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/comment.php
Related Hooks
Related hooks will be displayed here in future updates.