Changeset 3476026
- Timestamp:
- 03/06/2026 02:09:18 AM (4 weeks ago)
- Location:
- infility-global/trunk
- Files:
-
- 3 edited
-
infility_global.php (modified) (3 diffs)
-
widgets/infility-import-data/include/infility-import-excel.php (modified) (4 diffs)
-
widgets/infility-import-data/include/infility-import-file.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
infility-global/trunk/infility_global.php
r3474225 r3476026 4 4 Plugin URI: https://www.infility.cn/ 5 5 Description: Infility公共插件 6 Version: 2.14.5 66 Version: 2.14.57 7 7 Author: Infility 8 8 Author URI: https://www.infility.cn/ … … 142 142 v2.14.53 (20260211) Ben: 新增elepost列表组件的当前分类post功能。 143 143 v2.14.54 (20260224) Ben: 新增获取cf7表单数据接口,废弃infility_get_data接口。 144 v2.14.58 (20260306) Ben: 优化批量导入产品功能。 144 145 */ 145 146 … … 147 148 function __construct() 148 149 { 149 define( 'INFILITY_GLOBAL_VERSION', '2.14.5 6' );150 define( 'INFILITY_GLOBAL_VERSION', '2.14.57' ); 150 151 define( 'INFILITY_GLOBAL_PATH', plugin_dir_path( __FILE__ ) ); // fullpath/wp-content/plugins/infility-global/ // 有斜杠 151 152 define( 'INFILITY_GLOBAL_URL', plugins_url( '/', __FILE__ ) ); // https://the_domain/wp-content/plugins/infility-global/ // 斜杠是自己加的 -
infility-global/trunk/widgets/infility-import-data/include/infility-import-excel.php
r3416920 r3476026 49 49 if(empty($taxonomy_arr[$field])){continue;} 50 50 $terms = $taxonomy_arr[$field]; 51 $term = ''; 52 foreach($terms as $key1=>$value1){ 53 $format_value = str_replace('&', '&', $value); 54 if($format_value == $value1->name){ 55 $term = $value1; 56 break; 51 $term = []; 52 53 $value_arr = explode(',',$value); 54 if(!empty($value_arr)){ 55 foreach($value_arr as $key2=>$value2){ 56 $format_value = str_replace('&', '&', $value2); 57 foreach($terms as $key1=>$value1){ 58 if($format_value == $value1->name){ 59 $term[] = $value1; 60 break; 61 } 62 } 57 63 } 58 64 } 59 65 60 66 if(empty($term)){continue;} 61 67 … … 63 69 }else{ 64 70 if($field=='post_title'){ 65 $info[$field] = $value;71 $info[$field] = trim($value); 66 72 }else if($field=='s01_price'){ 67 73 $info[$field] = $this->special_rule($field,$value); … … 95 101 96 102 if($type=='text'){ 103 $format_data = trim($data); 104 }else if($type=='textarea'){ 97 105 $format_data = $data; 98 106 }else if($type=='repeater'){ … … 158 166 foreach($data as $k=>$v){ 159 167 if(taxonomy_exists($k)){ 160 if(!empty($v->term_id)){ 161 wp_set_object_terms( $post_id, $v->term_id, $k, true ); 168 if(is_array($v)){ 169 $term_ids = []; 170 foreach($v as $key=>$value){ 171 $term_ids[] = $value->term_id; 172 } 173 wp_set_object_terms( $post_id, $term_ids, $k, true ); 174 }else{ 175 if(!empty($v->term_id)){ 176 wp_set_object_terms( $post_id, $v->term_id, $k, true ); 177 } 162 178 } 163 179 }else{ -
infility-global/trunk/widgets/infility-import-data/include/infility-import-file.php
r3401623 r3476026 127 127 [ 128 128 'key' => 'sign', 129 'value' => $sign,129 'value' => trim($sign), 130 130 'compare' => '=', 131 131 ] … … 163 163 $acf_config = acf_get_field($acf_field); 164 164 if(empty($acf_config)){$this->error= $field.':acf 没有该字段信息';continue;} 165 if(!in_array($acf_config['type'],['gallery','image','file' ])){$this->error= $field.':字段类型错误';continue;}165 if(!in_array($acf_config['type'],['gallery','image','file','repeater'])){$this->error= $field.':字段类型错误';continue;} 166 166 if($acf_config['type']=='gallery'){ 167 167 $attach_id = $this->add_post_file($full_path); 168 168 $other_field[$acf_field][] = $attach_id; 169 }else if($acf_config['type']=='repeater'){ 170 $attach_id = $this->add_post_file($full_path); 171 $file_repeat = ['title'=>pathinfo($file_name, PATHINFO_FILENAME),'file'=>$attach_id]; 172 $other_field[$acf_field][] = $file_repeat; 169 173 }else{ 170 174 if(!empty($other_field[$acf_field])){continue;} … … 360 364 361 365 public function get_system_field($post_type){ 362 $allow_type = ['gallery','file','image' ];366 $allow_type = ['gallery','file','image','repeater']; 363 367 364 368 $field_groups = acf_get_field_groups([
Note: See TracChangeset
for help on using the changeset viewer.