Image 如何在WP帖子中传递图像的HTML ID和URL?

Image 如何在WP帖子中传递图像的HTML ID和URL?,image,wordpress,post,aviary,Image,Wordpress,Post,Aviary,我想把鸟舍编辑器整合到WordPress文章中,这样人们就可以点击文章中图像的编辑按钮,编辑并保存它。Aviary为最后两个提供了代码,但我不知道如何在编辑按钮的输入标记中传递帖子中图像的HTML ID和URL。我知道这是基本的,但我不是一个程序员,所以我肯定会感谢您的耐心和反馈。谢谢 以下是Aviary提供的输入静态代码: <!-- Add an edit button, passing the HTML id of the image and the public URL of the

我想把鸟舍编辑器整合到WordPress文章中,这样人们就可以点击文章中图像的编辑按钮,编辑并保存它。Aviary为最后两个提供了代码,但我不知道如何在编辑按钮的输入标记中传递帖子中图像的HTML ID和URL。我知道这是基本的,但我不是一个程序员,所以我肯定会感谢您的耐心和反馈。谢谢

以下是Aviary提供的输入静态代码:

<!-- 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。非常感谢您提供的任何反馈。

imageid是aviary使用的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>


您可能想看看这个插件: