Introduce register_meta(), get_metadata_by_mid(), and *_post_meta capabilities. fixes #17850

git-svn-id: https://develop.svn.wordpress.org/trunk@18445 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2011-07-20 22:04:35 +00:00
parent 14853ed87e
commit 6b5d8397b0
8 changed files with 118 additions and 45 deletions
+5 -1
View File
@@ -425,7 +425,11 @@ function post_custom_meta_box($post) {
<div id="ajax-response"></div>
<?php
$metadata = has_meta($post->ID);
list_meta($metadata);
foreach ( $metadata as $key => $value ) {
if ( is_protected_meta( $metadata[ $key ][ 'meta_key' ], 'post' ) || ! current_user_can( 'edit_post_meta', $post->ID, $metadata[ $key ][ 'meta_key' ] ) )
unset( $metadata[ $key ] );
}
list_meta( $metadata );
meta_form(); ?>
</div>
<p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>