list_meta
Outputs a post's public meta data in the Custom Fields meta box.
Description
list_meta( (array) $meta );
Parameters (1)
- 0. $meta (array)
- The meta.
Usage
if ( !function_exists( 'list_meta' ) ) { require_once ABSPATH . '/wp-admin/includes/template.php'; } // The meta. $meta = array(); // NOTICE! Understand what this does before running. $result = list_meta($meta);
Defined (1)
The function is defined in the following location(s).
- /wp-admin/includes/template.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