Summery Summery
Compares the lengths of comment data against the maximum character limits.
Syntax Syntax
Parameters Parameters
- $comment_data
-
(Required) Array of arguments for inserting a comment.
Return Return
(WP_Error|true) WP_Error when a comment field exceeds the limit, otherwise true.
Source Source
File: wp-includes/comment.php
return apply_filters( 'get_page_of_comment', (int) $page, $args, $original_args, $comment_ID ); } /** * Retrieves the maximum character lengths for the comment form fields. * * @since 4.5.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @return int[] Array of maximum lengths keyed by field name. */ function wp_get_comment_fields_max_lengths() { global $wpdb; $lengths = array( 'comment_author' => 245, 'comment_author_email' => 100, 'comment_author_url' => 200, 'comment_content' => 65525, );
Advertisement
Changelog Changelog
Version | Description |
---|---|
4.7.0 | Introduced. |