我需要以下方面的帮助:我创建了一个新的 <select>
WordPress 插件中的按钮。我希望插件中的此按钮在选中时从 WordPress 媒体库中选择图像并上传到客户表单。
简而言之,我需要管理员能够通过从媒体库中选择来更改表单的背景图像。
按钮看起来像这样:
<button>Select Image</button>
客户表单(预览结束):
<div id="giftcardForm" style="position:relative;">
<img src="url" id="background img" style="width:100%; height:auto; z-index:0;">
<div style="position:absolute; top:$from_y; left:$from_x; width:auto;" id="printname"></div>
<div style="position:absolute; top:20%; left:$from_x; width:auto;" id="print_to_name"></div>
<div style="position:absolute; top:30%; left:$from_x; width:auto;" id="showtext"></div>
</div>
最佳答案
试试这个!!
在前端使用 WordPress Media Loader
https://derekspringer.wordpress.com/2015/05/07/using-the-wordpress-media-loader-in-the-front-end/
希望这对您有所帮助。
关于php - 图片上传到客户表格作为背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46888098/