delete_meta() WordPress Function

The delete_meta() function is used to delete a custom field from a post. This function takes two arguments: the post ID and the meta key. The post ID is the ID of the post from which you want to delete the custom field. The meta key is the key of the custom field you want to delete.

delete_meta( int $mid ) #

Deletes post meta data by meta ID.


Parameters

$mid

(int)(Required)


Top ↑

Return

(bool)


Top ↑

Source

File: wp-admin/includes/post.php

function delete_meta( $mid ) {
	return delete_metadata_by_mid( 'post', $mid );
}


Top ↑

Changelog

Changelog
VersionDescription
1.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More