当您通过添加媒体按钮上传图像时,如何将post\\u id设置为0,该按钮将对async-upload.php
而不是实际的post\\u id?
非常感谢。
当您通过添加媒体按钮上传图像时,如何将post\\u id设置为0,该按钮将对async-upload.php
而不是实际的post\\u id?
非常感谢。
终于找到了答案,并检查它对我的情况是否有效。How to upload image without post ID using the new media uploader?
// Set post_id to 0 when Add Media button clicked
jQuery(\'#insert-media-button\').on(\'click\', function( event ){
event.preventDefault();
wp.media.model.settings.post.id = 0;
});
这将通过添加媒体按钮将上载的所有图像设置为0,显示为(Unattached)
在后端。我正在使用发件人。net获取电子邮件订阅列表。这个网站给了我一些信息,可以将用户的电子邮件添加到订阅列表中。我想使用WordPress ajax来实现这一点。但它返回错误400错误请求。我的代码是:文件ajax新闻脚本。js公司: jQuery(document).ready(function($){ // Perform AJAX send news on form submit $(\'form#fnews\').on(\'submit\', funct