delete_comment_meta

函式
delete_comment_meta ( $comment_id, $meta_key, $meta_value = '' )
引數
  • (int) $comment_id Comment ID.
    Required:
  • (string) $meta_key Metadata name.
    Required:
  • (mixed) $meta_value Optional. Metadata value. If provided, rows will only be removed that match the value. Must be serializable if non-scalar. Default empty.
    Required:
    Default: (empty)
返回值
  • (bool) True on success, false on failure.
定義位置
相關方法
get_comment_metaupdate_comment_metadelete_post_metaadd_comment_metawp_delete_comment
引入
2.9.0
棄用
-

delete_comment_meta: 這個函式刪除一個與評論相關的後設資料。

移除評論中的後設資料匹配標準。

你可以根據鍵或者鍵和值來匹配。基於鍵和值的移除,可以避免移除具有相同鍵的重複後設資料。如果需要的話,它還可以刪除所有與鍵匹配的後設資料。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function delete_comment_meta( $comment_id, $meta_key, $meta_value = '' ) {
return delete_metadata( 'comment', $comment_id, $meta_key, $meta_value );
}
function delete_comment_meta( $comment_id, $meta_key, $meta_value = '' ) { return delete_metadata( 'comment', $comment_id, $meta_key, $meta_value ); }
function delete_comment_meta( $comment_id, $meta_key, $meta_value = '' ) {
	return delete_metadata( 'comment', $comment_id, $meta_key, $meta_value );
}

常見問題

FAQs
檢視更多 >