0
我正在創建一個名爲Article的自定義帖子類型。該文章需要使用Tiny MCE的稱爲簽名的字段。如何使用Tiny MCE添加WordPress自定義帖子類型字段
我能夠做到這一點,但有一個額外的邊界顯示在微小的MCE編輯器之外。
http://webypedia.com/wp-content/uploads/2010/07/tiny-mce-custom-field.jpg
我的目標是讓類似帖子編輯簽名字段編輯器。
這裏是我使用產生的第一個圖像中編輯當前代碼:
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
}