get_post_meta_by_id() WordPress Function
The get_post_meta_by_id() function allows you to retrieve post meta data by post ID. This is useful if you need to access post meta data for a specific post, outside of the normal post loop.
get_post_meta_by_id( int $mid ) #
Returns post meta data by meta ID.
Parameters
- $mid
(int)(Required)
Return
(object|bool)
Source
File: wp-admin/includes/post.php
function get_post_meta_by_id( $mid ) { return get_metadata_by_mid( 'post', $mid ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.1.0 | Introduced. |