the_meta

Display list of post custom fields.

Description

the_meta(); 

Usage

  1. if ( !function_exists( 'the_meta' ) ) { 
  2. require_once ABSPATH . WPINC . '/post-template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = the_meta(); 
  7.  

Defined (1)

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

/wp-includes/post-template.php  
  1. function the_meta() { 
  2. if ( $keys = get_post_custom_keys() ) { 
  3. echo "<ul class='post-meta'>\n"; 
  4. foreach ( (array) $keys as $key ) { 
  5. $keyt = trim($key); 
  6. if ( is_protected_meta( $keyt, 'post' ) ) 
  7. continue; 
  8. $values = array_map('trim', get_post_custom_values($key)); 
  9. $value = implode($values, ', '); 
  10.  
  11. /** 
  12. * Filters the HTML output of the li element in the post custom fields list. 
  13. * @since 2.2.0 
  14. * @param string $html The HTML output for the li element. 
  15. * @param string $key Meta key. 
  16. * @param string $value Meta value. 
  17. */ 
  18. echo apply_filters( 'the_meta_key', "<li><span class='post-meta-key'>$key:</span> $value</li>\n", $key, $value ); 
  19. echo "</ul>\n";