QQWorld Auto Save Images - Version 1.7.11.3

Version Description

Download this release

Release Info

Developer qqworld
Plugin Icon 128x128 QQWorld Auto Save Images
Version 1.7.11.3
Comparing to
See all releases

Code changes from version 1.7.11.2 to 1.7.11.3

Files changed (2) hide show
  1. js/admin.js +0 -4
  2. qqworld-auto-save-images.php +45 -3
js/admin.js CHANGED
@@ -468,10 +468,6 @@ QQWorld_auto_save_images.scan_posts = function() {
468
  data = $(data);
469
  $('#categories_block').html(data);
470
  data.hide().fadeIn('normal');
471
- $('#categories_block > div').each(function() {
472
- var posttype = $(this).attr('post-type');
473
- $(this).find('input').attr('name', 'terms['+posttype+'][]');
474
- });
475
  } else $('#categories_block').html(data);
476
  },
477
  error: _this.action.catch_errors
468
  data = $(data);
469
  $('#categories_block').html(data);
470
  data.hide().fadeIn('normal');
 
 
 
 
471
  } else $('#categories_block').html(data);
472
  },
473
  error: _this.action.catch_errors
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.7.11.2
7
  Author: Michael Wang
8
  Author URI: http://www.qqworld.org
9
  Text Domain: qqworld_auto_save_images
@@ -92,7 +92,8 @@ class QQWorld_auto_save_images {
92
  $taxonomy = get_taxonomy($tax);
93
  echo '<div id="'.$tax.'div" post-type="'.$tax.'" class="postbox"><div class="hndle">'.$taxonomy->labels->name.'</div><div class="inside"><div id="'.$tax.'-all" class="tabs-panel"><ul>';
94
  wp_terms_checklist('', array(
95
- 'taxonomy' => $tax
 
96
  ));
97
  echo '</ul></div></div></div>';
98
  } else _e('No taxonomies found.', 'qqworld_auto_save_images');
@@ -1189,4 +1190,45 @@ class QQWorld_auto_save_images {
1189
  return $attach_id;
1190
  }
1191
  }
1192
- new QQWorld_auto_save_images;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.7.11.3
7
  Author: Michael Wang
8
  Author URI: http://www.qqworld.org
9
  Text Domain: qqworld_auto_save_images
92
  $taxonomy = get_taxonomy($tax);
93
  echo '<div id="'.$tax.'div" post-type="'.$tax.'" class="postbox"><div class="hndle">'.$taxonomy->labels->name.'</div><div class="inside"><div id="'.$tax.'-all" class="tabs-panel"><ul>';
94
  wp_terms_checklist('', array(
95
+ 'taxonomy' => $tax,
96
+ 'walker' => new QQWorld_Save_Remote_Images_Walker_Category_Checklist
97
  ));
98
  echo '</ul></div></div></div>';
99
  } else _e('No taxonomies found.', 'qqworld_auto_save_images');
1190
  return $attach_id;
1191
  }
1192
  }
1193
+ new QQWorld_auto_save_images;
1194
+
1195
+ class QQWorld_Save_Remote_Images_Walker_Category_Checklist extends Walker {
1196
+ public $tree_type = 'category';
1197
+ public $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this
1198
+
1199
+ public function start_lvl( &$output, $depth = 0, $args = array() ) {
1200
+ $indent = str_repeat("\t", $depth);
1201
+ $output .= "$indent<ul class='children'>\n";
1202
+ }
1203
+ public function end_lvl( &$output, $depth = 0, $args = array() ) {
1204
+ $indent = str_repeat("\t", $depth);
1205
+ $output .= "$indent</ul>\n";
1206
+ }
1207
+ public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
1208
+ if ( empty( $args['taxonomy'] ) ) {
1209
+ $taxonomy = 'category';
1210
+ } else {
1211
+ $taxonomy = $args['taxonomy'];
1212
+ }
1213
+
1214
+ if ( $taxonomy == 'category' ) {
1215
+ $name = 'post_category';
1216
+ } else {
1217
+ $name = 'tax_input[' . $taxonomy . ']';
1218
+ }
1219
+ $args['popular_cats'] = empty( $args['popular_cats'] ) ? array() : $args['popular_cats'];
1220
+ $class = in_array( $category->term_id, $args['popular_cats'] ) ? ' class="popular-category"' : '';
1221
+
1222
+ $args['selected_cats'] = empty( $args['selected_cats'] ) ? array() : $args['selected_cats'];
1223
+
1224
+ /** This filter is documented in wp-includes/category-template.php */
1225
+ $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" .
1226
+ '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="terms['.$taxonomy.'][]" id="in-'.$taxonomy.'-' . $category->term_id . '"' .
1227
+ checked( in_array( $category->term_id, $args['selected_cats'] ), true, false ) .
1228
+ disabled( empty( $args['disabled'] ), false, false ) . ' /> ' .
1229
+ esc_html( apply_filters( 'the_category', $category->name ) ) . '</label>';
1230
+ }
1231
+ public function end_el( &$output, $category, $depth = 0, $args = array() ) {
1232
+ $output .= "</li>\n";
1233
+ }
1234
+ }