Comment Meta Box

<?php

function my_comment_meta_box($comment){?>
<div class="meta-box-sortables" id="normal-sortables">
<div class="postbox " id="wedco-com-meta">
<div title="Click to toggle" class="handlediv"><br></div>
<h3 class="hndle"><span>My Meta</span></h3>
<div class="inside">

<?php echo 'put meta box stuff here'; ?>

</div>
</div>
</div>
<?php
}
add_action('add_meta_boxes_comment','my_comment_meta_box');

//Save Comment Meta - No form in the above example - this is extra and for future reference
function my_save_comment_meta() {
$comment_id = $_POST['comment_ID'];
$posted_meta = $_POST['my_meta_name'];
update_comment_meta($comment_id,'my_meta_name',$posted_meta);
}
add_action('edit_comment','my_save_comment_meta');

?>

0 Comments

You must be logged in to post a comment.