I am creating a custom post type called Article. The article needs a field called signature that uses the Tiny MCE.
I was able to achieve this but there is an extra border that shows outside the Tiny MCE Editor.
http://webypedia.com/wp-content/uploads/2010/07/tiny-mce-custom-field.jpg
My goal is to make the signature field editor similar to the post editor.
Here is the current code I am using that produces that editor in the first image:
function admin_init(){
add_meta_box("signature_meta", "Signature", "signature_meta", "article", "normal", "low");
}
function signature_meta() {
global $post;
$custom = get_post_custom($post->ID);
$signature = $custom["signature"][0];
?>
<div class="postbox">
<textarea name="signature" class="signature" id='signature'><?php echo $signature; ?></textarea>
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#signature").addClass("mceEditor");
if ( typeof( tinyMCE ) == "object" && typeof( tinyMCE.execCommand ) == "function" ) {
tinyMCE.execCommand("mceAddControl", false, "signature");
}
});
</script>
<?php
}