时间:2024-03-09
WordPress函数get_post_custom_values返回文章所有元数据的值。
get_post_custom_values( string $key = '', int $post_id )
$key
字符串
自定义字段的键
$post_id
整数
文章的ID
Array ( [0] => 123 )
$mykey_values = get_post_custom_values( 'views' ); foreach ( $mykey_values as $key => $value ) { echo "$key => $value ( 'views' )<br />"; }
get_post_custom_values()函数位于:wp-includes/post.php
相关函数:
get_post_custom()
get_post_custom_keys()
the_meta()
get_post_meta()
Copyright © 2019-2024 jsp.hk