2013-02-05 93 views
2

我想將Aviary編輯器合併到WordPress的文章中,這樣人們可以點擊文章中圖像的編輯按鈕,編輯並保存它。 Aviary提供了最後兩個代碼,但我不知道如何在編輯按鈕的輸入標籤中傳遞圖像的HTML ID和URL。我知道這是基本的,但我不是程序員,所以我一定會感謝您的耐心和反饋。謝謝。如何在WP帖子中傳遞圖片的HTML ID和URL?

這裏是輸入靜態代碼百鳥規定:

<!-- Add an edit button, passing the HTML id of the image and the public URL of the image --><p> 
<input type='image' src='http://images.aviary.com/images/edit-photo.png' value='Edit photo' 
onclick="return launchEditor('imageid', 'url');" /></p> 

我需要知道如何通過ID和URL的代碼的最後一行。非常感謝您提供的任何反饋。

+0

你可能想看看這個插件:http://en.bainternet.info/2012/aviary-editor-for-wordpress –

回答

0

圖像標識是div ID通過鳥舍用,你只需要塗創建

<div id="imageid"></div> 

的獲得圖像的URL,你可以喜歡這個

<?php 
    $image = wp_get_attachment_image_src($post->ID); 
    $url = $image[0]; 
?> 

<input type='image' src='http://images.aviary.com/images/edit-photo.png' value='Edit photo' onclick="return launchEditor('imageid', '<?php echo $url; ?>');" /></p> 

我以爲你會把它放在附件頁