Version Description
Download this release
Release Info
Developer | qqworld |
Plugin | QQWorld Auto Save Images |
Version | 1.4.2 |
Comparing to | |
See all releases |
Code changes from version 1.4.1 to 1.4.2
qqworld-auto-save-images.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: QQWorld Auto Save Images
|
4 |
Plugin URI: https://wordpress.org/plugins/qqworld-auto-save-images/
|
5 |
Description: Automatically keep the all remote picture to the local, and automatically set featured image. 自动保存远程图片到本地,自动设置特色图片,并且支持机器人采集软件从外部提交。
|
6 |
-
Version: 1.4.
|
7 |
Author: Michael Wang
|
8 |
Author URI: http://www.qqworld.org
|
9 |
*/
|
@@ -92,7 +92,7 @@ class QQWorld_auto_save_images {
|
|
92 |
var init = function() {
|
93 |
$('.button.save_remote_images').removeClass('success').html(icon+QQWorld_auto_save_images.text.save_remote_images);
|
94 |
}
|
95 |
-
$('#content').val(respond)
|
96 |
setTimeout(init, 3000);
|
97 |
}
|
98 |
});
|
@@ -112,7 +112,7 @@ class QQWorld_auto_save_images {
|
|
112 |
var init = function() {
|
113 |
$('.button.save_remote_images').removeClass('success').html(icon+QQWorld_auto_save_images.text.save_remote_images);
|
114 |
}
|
115 |
-
tinyMCE.activeEditor.setContent(respond);
|
116 |
setTimeout(init, 3000);
|
117 |
}
|
118 |
});
|
@@ -241,6 +241,7 @@ class QQWorld_auto_save_images {
|
|
241 |
}
|
242 |
|
243 |
function save_remote_images() {
|
|
|
244 |
//Check to make sure function is not executed more than once on save
|
245 |
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
|
246 |
return;
|
@@ -251,7 +252,7 @@ class QQWorld_auto_save_images {
|
|
251 |
$post_id = $_POST['post_id'];
|
252 |
$content = $this->js_unescape($_POST['content']);
|
253 |
|
254 |
-
$preg=preg_match_all('/<img.*?src="(.*?)(\?.*?)?"/',stripslashes($content),$matches);
|
255 |
if($preg){
|
256 |
foreach($matches[1] as $image_url){
|
257 |
if(empty($image_url)) continue;
|
@@ -269,6 +270,7 @@ class QQWorld_auto_save_images {
|
|
269 |
}
|
270 |
|
271 |
function fetch_images($post_id) {
|
|
|
272 |
//Check to make sure function is not executed more than once on save
|
273 |
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
|
274 |
return;
|
@@ -280,7 +282,7 @@ class QQWorld_auto_save_images {
|
|
280 |
|
281 |
$post=get_post($post_id);
|
282 |
$content=$post->post_content;
|
283 |
-
$preg=preg_match_all('/<img.*?src="(.*?)(\?.*?)?"/',stripslashes($content),$matches);
|
284 |
if($preg){
|
285 |
foreach($matches[1] as $image_url){
|
286 |
if(empty($image_url)) continue;
|
3 |
Plugin Name: QQWorld Auto Save Images
|
4 |
Plugin URI: https://wordpress.org/plugins/qqworld-auto-save-images/
|
5 |
Description: Automatically keep the all remote picture to the local, and automatically set featured image. 自动保存远程图片到本地,自动设置特色图片,并且支持机器人采集软件从外部提交。
|
6 |
+
Version: 1.4.2
|
7 |
Author: Michael Wang
|
8 |
Author URI: http://www.qqworld.org
|
9 |
*/
|
92 |
var init = function() {
|
93 |
$('.button.save_remote_images').removeClass('success').html(icon+QQWorld_auto_save_images.text.save_remote_images);
|
94 |
}
|
95 |
+
if (respond) $('#content').val(respond)
|
96 |
setTimeout(init, 3000);
|
97 |
}
|
98 |
});
|
112 |
var init = function() {
|
113 |
$('.button.save_remote_images').removeClass('success').html(icon+QQWorld_auto_save_images.text.save_remote_images);
|
114 |
}
|
115 |
+
if (respond) tinyMCE.activeEditor.setContent(respond);
|
116 |
setTimeout(init, 3000);
|
117 |
}
|
118 |
});
|
241 |
}
|
242 |
|
243 |
function save_remote_images() {
|
244 |
+
set_time_limit(0);
|
245 |
//Check to make sure function is not executed more than once on save
|
246 |
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
|
247 |
return;
|
252 |
$post_id = $_POST['post_id'];
|
253 |
$content = $this->js_unescape($_POST['content']);
|
254 |
|
255 |
+
$preg=preg_match_all('/<img.*?src="((?![\"\']).*?)((?![\"\'])\?.*?)?"/',stripslashes($content),$matches);
|
256 |
if($preg){
|
257 |
foreach($matches[1] as $image_url){
|
258 |
if(empty($image_url)) continue;
|
270 |
}
|
271 |
|
272 |
function fetch_images($post_id) {
|
273 |
+
set_time_limit(0);
|
274 |
//Check to make sure function is not executed more than once on save
|
275 |
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
|
276 |
return;
|
282 |
|
283 |
$post=get_post($post_id);
|
284 |
$content=$post->post_content;
|
285 |
+
$preg=preg_match_all('/<img.*?src="((?![\"\']).*?)((?![\"\'])\?.*?)?"/',stripslashes($content),$matches);
|
286 |
if($preg){
|
287 |
foreach($matches[1] as $image_url){
|
288 |
if(empty($image_url)) continue;
|