delete_post_meta_by_key

函式
delete_post_meta_by_key ( $post_meta_key )
引數
  • (string) $post_meta_key Key to search for when deleting.
    Required:
返回值
  • (bool) Whether the post meta key was deleted from the database.
定義位置
相關方法
delete_site_meta_by_keydelete_post_metaget_post_meta_by_iddelete_site_metaget_post_meta
引入
2.3.0
棄用
-

delete_post_meta_by_key: 這個函式為一個特定的文章按元鍵刪除一個元欄位。

刪除與給定的元關鍵字匹配的文章元中的所有內容。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function delete_post_meta_by_key( $post_meta_key ) {
return delete_metadata( 'post', null, $post_meta_key, '', true );
}
function delete_post_meta_by_key( $post_meta_key ) { return delete_metadata( 'post', null, $post_meta_key, '', true ); }
function delete_post_meta_by_key( $post_meta_key ) {
	return delete_metadata( 'post', null, $post_meta_key, '', true );
}

常見問題

FAQs
檢視更多 >