Changeset 3246395
- Timestamp:
- 02/25/2025 11:22:08 AM (13 months ago)
- Location:
- recruitly/trunk
- Files:
-
- 3 edited
-
admin/dataloader.php (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
-
recruitly.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
recruitly/trunk/admin/dataloader.php
r3246334 r3246395 104 104 )); 105 105 106 $sector_id = recruitly_get_taxonomy_id($job->sector, 'jobsector');107 106 $job_type_id = recruitly_get_taxonomy_id($job->jobType, 'jobtype'); 108 107 … … 262 261 } 263 262 263 $sector_ids = []; 264 265 try { 266 if (isset($job->sector) && !empty($job->sector)) { 267 $sectors = array_map('trim', explode(',', $job->sector)); // Split CSV string into array 268 foreach ($sectors as $sector) { 269 try { 270 $sector_id = recruitly_get_taxonomy_id($sector, 'jobsector'); 271 if (!empty($sector_id)) { 272 $sector_ids[] = $sector_id; // Collect valid term IDs 273 } 274 } catch (Throwable $ex) { 275 echo esc_html($ex->getMessage()); 276 } 277 } 278 } 279 } catch (Throwable $ex) { 280 echo esc_html($ex->getMessage()); 281 } 282 283 if (!empty($sector_ids)) { 284 wp_set_post_terms($post_id, $sector_ids, 'jobsector', false); 285 } 286 264 287 if (!empty($industry_ids)) { 265 288 wp_set_post_terms($post_id, $industry_ids, 'jobindustry', false); … … 280 303 if (!empty($job_type_id)) { 281 304 wp_set_post_terms($post_id, array($job_type_id), 'jobtype', false); 282 }283 284 if (!empty($sector_id)) {285 wp_set_post_terms($post_id, array($sector_id), 'jobsector', false);286 305 } 287 306 … … 331 350 )); 332 351 333 $sector_id = recruitly_get_taxonomy_id($job->sector, 'jobsector');334 352 $job_type_id = recruitly_get_taxonomy_id($job->jobType, 'jobtype'); 335 353 … … 519 537 } 520 538 539 $sector_ids = []; 540 541 try { 542 if (isset($job->sector) && !empty($job->sector)) { 543 $sectors = array_map('trim', explode(',', $job->sector)); // Split CSV string into array 544 foreach ($sectors as $sector) { 545 try { 546 $sector_id = recruitly_get_taxonomy_id($sector, 'jobsector'); 547 if (!empty($sector_id)) { 548 $sector_ids[] = $sector_id; // Collect valid term IDs 549 } 550 } catch (Throwable $ex) { 551 echo esc_html($ex->getMessage()); 552 } 553 } 554 } 555 } catch (Throwable $ex) { 556 echo esc_html($ex->getMessage()); 557 } 558 559 if (!empty($sector_ids)) { 560 wp_set_post_terms($post_id, $sector_ids, 'jobsector', false); 561 }else { 562 wp_set_post_terms($post_id, [], 'jobsector', false); // Clear all terms if no industries are specified 563 } 564 521 565 // Assign or clear industry terms 522 566 if (!empty($industry_ids)) { … … 540 584 if (!empty($job_type_id)) { 541 585 wp_set_post_terms($post_id, array($job_type_id), 'jobtype', false); 542 }543 544 if (!empty($sector_id)) {545 wp_set_post_terms($post_id, array($sector_id), 'jobsector', false);546 586 } 547 587 -
recruitly/trunk/readme.txt
r3246355 r3246395 4 4 Requires at least: 4.5 5 5 Tested up to: 6.7.1 6 Stable tag: 2.0.2 76 Stable tag: 2.0.28 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 122 122 * Fix issue with multiple industries in taxonomies. 123 123 124 = 2.0.28 = 125 * Fix issue with multiple sectors in taxonomies. 126 124 127 == Upgrade Notice == 125 128 -
recruitly/trunk/recruitly.php
r3246355 r3246395 4 4 Plugin URI: https://recruitly.io 5 5 Description: Recruitly job board integration. 6 Version: 2.0.2 76 Version: 2.0.28 7 7 Author: Recruitly 8 8 Author URI: https://recruitly.io … … 15 15 exit; // Exit if accessed directly 16 16 } 17 define('RECRUITLY_PLUGIN_VERSION', '2.0.2 7');17 define('RECRUITLY_PLUGIN_VERSION', '2.0.28'); 18 18 19 19 defined('RECRUITLY_POST_TYPE') or define('RECRUITLY_POST_TYPE', 'current-vacancies');
Note: See TracChangeset
for help on using the changeset viewer.