简体   繁体   English

Wordpress中的API上传文件

[英]API Upload file in Wordpress

I am not sure if Wordpress has API to upload file but what I am looking for is very simple: 我不确定Wordpress是否具有用于上传文件的API,但是我要查找的内容非常简单:

Context: I have another plugin that I need to modify so that user can upload file in the Admin area of that plugin Solution: 上下文:我需要修改另一个插件,以便用户可以在该插件的“管理”区域中上载文件。解决方案:
1. Rewrite a new upload thru some specific path. 1.通过某些特定路径重写新的上传。 This has nothing to do with Wordpress. 这与Wordpress无关。 I am fine doing this. 我这样做很好。
2. I prefer to use existing Media upload feature or some Wordpress upload API. 2.我更喜欢使用现有的媒体上传功能或某些Wordpress上传API。 I read this post but it was problematic because I want to change the text title of "Insert to Post" to "Finish Upload". 我读了这篇文章,但这是有问题的,因为我想将“插入文章”的文本标题更改为“完成上传”。
http://www.webmaster-source.com/2010/01/08/using-the-wordpress-uploader-in-your-plugin-or-theme/ http://www.webmaster-source.com/2010/01/08/using-the-wordpress-uploader-in-your-plugin-or-theme/

Can anyone help? 有人可以帮忙吗? Prefer to go with #2 but just need to change the text. 最好选择#2,但只需要更改文本即可。 How do I change it when it is a fanbox appearing when image button is clicked? 单击图像按钮时出现风扇框时,如何更改它? And the "Insert to Post" doesn't come out until the image is done uploading. 直到图片上传完成后,“插入发布”才会显示出来。 The issue is how to trigger a function to change that text when fancybox is shown and image uploading completed!!? 问题是当显示fancybox并且图像上传完成时,如何触发功能来更改文本!?

我将Post id放入url,它解决了问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM