在“自定义字段”元框中输出帖子的公共元数据。
原型
list_meta( array $meta )
参数
$meta
(array)
(Required)
源文件
路径:wp-admin/includes/template.php
<?php
...
function list_meta( $meta ) {
// Exit if no meta
if ( ! $meta ) {
echo '
<table id="list-table" style="display: none;">
<thead>
<tr>
<th class="left">' . _x( 'Name', 'meta name' ) . '</th>
<th>' . __( 'Value' ) . '</th>
</tr>
</thead>
<tbody id="the-list" data-wp-lists="list:meta">
<tr><td></td></tr>
</tbody>
</table>'; //TBODY needed for list-manipulation JS
return;
}
$count = 0;
?>
<table id="list-table">
<thead>
<tr>
<th class="left"><?php _ex( 'Name', 'meta name' ) ?></th>
<th><?php _e( 'Value' ) ?></th>
</tr>
</thead>
<tbody id='the-list' data-wp-lists='list:meta'>
<?php
foreach ( $meta as $entry )
echo _list_meta_row( $entry, $count );
?>
</tbody>
</table>
<?php
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/list_meta/