get_post_custom()
最后更新于:2021-11-26 22:28:30
get_post_custom( int$post_id)Retrieve post meta fields, based on post ID.
参数
- $post_id
-
(int) (Optional) Post ID. Default is ID of the global $post.
响应
(array) Post meta for the given post.
源文件
文件: gc-includes/post.php
function get_post_custom( $post_id = 0 ) {
$post_id = absint( $post_id );
if ( ! $post_id ) {
$post_id = get_the_ID();
}
return get_post_meta( $post_id );
}