rest_comment_trashable

過濾鉤子
apply_filters( 'rest_comment_trashable', ( EMPTY_TRASH_DAYS > 0 )
引數
  • (bool) $supports_trash Whether the comment supports trashing.
    Required:
  • (WP_Comment) $comment The comment object being considered for trashing support.
    Required:
定義位置
相關勾子
rest_comment_queryget_comment_textget_comment_datecomment_on_trashget_comment_type
相關方法
wp_comment_trashnoticeget_comment_typeget_comment_dateget_comment_textget_comment_timeget_comment_statuses
引入
4.7.0
棄用
-

rest_comment_trashable – 這個鉤子用來確定評論是否可以通過WordPress REST API被扔掉(移到垃圾桶)。如果需要,開發者可以使用這個鉤子來改變這個行為。

過濾評論是否可以通過REST API進行垃圾處理。

返回false表示禁用對評論的垃圾支援。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$supports_trash = apply_filters( 'rest_comment_trashable', ( EMPTY_TRASH_DAYS > 0 ), $comment );
$supports_trash = apply_filters( 'rest_comment_trashable', ( EMPTY_TRASH_DAYS > 0 ), $comment );
$supports_trash = apply_filters( 'rest_comment_trashable', ( EMPTY_TRASH_DAYS > 0 ), $comment );

常見問題

FAQs
檢視更多 >