钩子文档

wp_get_comment_fields_max_lengths

💡 云策文档标注

概述

本文档介绍 WordPress 中的 wp_get_comment_fields_max_lengths 过滤器,用于过滤评论表单字段的最大长度。该过滤器允许开发者自定义字段长度限制。

关键要点

  • wp_get_comment_fields_max_lengths 是一个过滤器,可修改评论表单字段的最大字符长度。
  • 参数 $lengths 是一个整数数组,键为字段名,值为最大长度。
  • 该过滤器在 wp_get_comment_fields_max_lengths() 函数中被调用,用于检索字段长度。
  • 自 WordPress 4.5.0 版本引入。

📄 原文内容

Filters the lengths for the comment form fields.

Parameters

$lengthsint[]
Array of maximum lengths keyed by field name.

Source

return apply_filters( 'wp_get_comment_fields_max_lengths', $lengths );

Changelog

Version Description
4.5.0 Introduced.