Changeset 946 for trunk/wp-includes/template-functions-post.php
- Timestamp:
- 02/26/2004 09:42:47 PM (23 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/template-functions-post.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/template-functions-post.php
r945 r946 444 444 } 445 445 446 /* 447 * Post-meta: Custom per-post fields. 448 */ 449 450 function get_post_custom() { 451 global $id, $post_meta_cache; 452 453 return $post_meta_cache[$id]; 454 } 455 456 function get_post_custom_keys() { 457 global $id, $post_meta_cache; 458 459 if (!is_array($post_meta_cache[$id])) 460 return; 461 if ($keys = array_keys($post_meta_cache[$id])) 462 return $keys; 463 } 464 465 function get_post_custom_values($key='') { 466 global $id, $post_meta_cache; 467 468 return $post_meta_cache[$id][$key]; 469 } 470 471 // this will probably change at some point... 472 function the_meta() { 473 global $id, $post_meta_cache; 474 475 if ($keys = get_post_custom_keys()) { 476 echo "<ul>\n"; 477 foreach ($keys as $key) { 478 $value = implode($post_meta_cache[$id][$key],','); 479 480 echo "<li>$key: $value</li>\n"; 481 } 482 echo "</ul>\n"; 483 } 484 } 485 446 486 ?>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)