2013-02-05 31 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> 

我以为你会把它放在附件页