comment_max_links_url

Filters the number of links found in a comment.

Description

apply_filters( 'comment_max_links_url', (int) $num_links, (string) $url, (string) $comment ); 

Parameters (3)

0. $num_links (int)
The number of links found.
1. $url (string)
Comment author's URL. Included in allowed links total.
2. $comment (string)
Content of the comment.

Usage

To run the hook, copy the example below.
  1. $num_links = apply_filters( 'comment_max_links_url', $num_links, $url, $comment ); 
  2.  
  3. if ( !empty( $num_links ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the comment_max_links_url callback 
  2. function filter_comment_max_links_url( $num_links, $url, $comment ) { 
  3. // make filter magic happen here... 
  4. return $num_links
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'comment_max_links_url', 'filter_comment_max_links_url', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'comment_max_links_url', 'filter_comment_max_links_url', 10, 3 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/comment.php  
  1. $num_links = apply_filters( 'comment_max_links_url', $num_links, $url, $comment );