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

  1. if ( !function_exists( 'list_meta' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/template.php'; 
  3.  
  4. // The meta. 
  5. $meta = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = list_meta($meta); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/template.php  
  1. function list_meta( $meta ) { 
  2. // Exit if no meta 
  3. if ( ! $meta ) { 
  4. echo ' 
  5. <table id="list-table" style="display: none;"> 
  6. <thead> 
  7. <tr> 
  8. <th class="left">' . _x( 'Name', 'meta name' ) . '</th> 
  9. <th>' . __( 'Value' ) . '</th> 
  10. </tr> 
  11. </thead> 
  12. <tbody id="the-list" data-wp-lists="list:meta"> 
  13. <tr><td></td></tr> 
  14. </tbody> 
  15. </table>'; //TBODY needed for list-manipulation JS 
  16. return; 
  17. $count = 0; 
  18. ?> 
  19. <table id="list-table"> 
  20. <thead> 
  21. <tr> 
  22. <th class="left"><?php _ex( 'Name', 'meta name' ) ?></th> 
  23. <th><?php _e( 'Value' ) ?></th> 
  24. </tr> 
  25. </thead> 
  26. <tbody id='the-list' data-wp-lists='list:meta'> 
  27. <?php 
  28. foreach ( $meta as $entry ) 
  29. echo _list_meta_row( $entry, $count ); 
  30. ?> 
  31. </tbody> 
  32. </table> 
  33. <?php