unregister_post_meta() WordPress Function
The unregister_post_meta() function can be used to remove custom fields from a post type. This function takes two parameters: the post type name and the custom field name.
unregister_post_meta( string $post_type, string $meta_key ) #
Unregisters a meta key for posts.
Parameters
- $post_type
(string)(Required)Post type the meta key is currently registered for. Pass an empty string if the meta key is registered across all existing post types.
- $meta_key
(string)(Required)The meta key to unregister.
Return
(bool) True on success, false if the meta key was not previously registered.
Source
File: wp-includes/post.php
function unregister_post_meta( $post_type, $meta_key ) { return unregister_meta_key( 'post', $meta_key, $post_type ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.9.8 | Introduced. |