WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
3653 |
|
3654 | /** |
3655 | * Filters whether an empty comment should be allowed. |
3656 | * |
3657 | * @since 5.1.0 |
3658 | * |
3659 | * @param bool $allow_empty_comment Whether to allow empty comments. Default false. |
3660 | * @param array $commentdata Array of comment data to be sent to wp_insert_comment(). |
3661 | */ |
3662 | $allow_empty_comment = apply_filters( 'allow_empty_comment', false, $commentdata ); |
3663 | if ( '' === $comment_content && ! $allow_empty_comment ) { |
3664 | return new WP_Error( 'require_valid_comment', __( '<strong>Error:</strong> Please type your comment text.' ), 200 ); |
3665 | } |
3666 |
|
3667 | $check_max_lengths = wp_check_comment_data_max_lengths( $commentdata ); |
3668 | if ( is_wp_error( $check_max_lengths ) ) { |
3669 | return $check_max_lengths; |
3670 | } |
3671 |
|