allow_empty_comment

過濾鉤子
apply_filters( 'allow_empty_comment', false, $commentdata )
引數
  • (bool) $allow_empty_comment Whether to allow empty comments. Default false.
    Required:
  • (array) $commentdata Array of comment data to be sent to wp_insert_comment().
    Required:
定義位置
相關勾子
get_commentedit_commentrest_allow_anonymous_commentswp_insert_commentwp_count_comments
相關方法
wp_allow_commentget_commentedit_commentget_commentshave_commentswp_trash_comment
引入
5.1.0
棄用
-

allow_empty_comment是一個過濾器,允許你修改是否允許提交空評論。預設情況下,空評論是不允許的,但這個過濾器可以用來改變這一點。

過濾是否應該允許空評論。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$allow_empty_comment = apply_filters( 'allow_empty_comment', false, $commentdata );
$allow_empty_comment = apply_filters( 'allow_empty_comment', false, $commentdata );
$allow_empty_comment = apply_filters( 'allow_empty_comment', false, $commentdata );

常見問題

FAQs
檢視更多 >