wpseek.com
A WordPress-centric search engine for devs and theme authors
post_custom_meta_box › WordPress Function
Since2.6.0
Deprecatedn/a
› post_custom_meta_box ( $post )
| Parameters: |
|
| Defined at: |
|
| Codex: |
Displays custom fields form fields.
Related Functions: post_author_meta_box, post_comment_meta_box, post_submit_meta_box, post_format_meta_box, post_tags_meta_box
Source
function post_custom_meta_box( $post ) {
?>
<div id="postcustomstuff">
<div id="ajax-response"></div>
<?php
$metadata = has_meta( $post->ID );
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( $post );
?>
</div>
<p>
<?php
printf(
/* translators: %s: Documentation URL. */
__( 'Custom fields can be used to add extra metadata to a post that you can <a href="%s">use in your theme</a>.' ),
__( 'https://wordpress.org/documentation/article/assign-custom-fields/' )
);
?>
</p>
<?php
}