php - 图片上传到客户表格作为背景

标签 php jquery html css wordpress

我需要以下方面的帮助:我创建了一个新的 <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/

相关文章:

php - 使用 Laravel 4 Eloquent 连接列时列名 ' ' 无效?

php - 正则表达式从任何字符串中获取日期 yyyy-mm-dd

html - 为什么网格不会将标有 "."的单元格留空?

html - 在 IE11 中使元素具有粘性

javascript - 图像顶部出现奇怪的线条错误?

javascript - jquery html 获取可见元素数据-foo

php - 将 csv 文件中的大数据插入数据库

javascript - 如何使用 jQuery Ajax.Request 将多个变量类型传递给 php

javascript - 使用从 AjaxSubmit 返回的数据

javascript - 类型错误 : $ is not a function