In cablecast_sync_projects, there is no mechanism to remove a project that has been removed on the backend.
|
function cablecast_sync_projects($projects) { |
|
foreach ($projects as $project) { |
|
$processed = cablecast_replace_commas_in_tag($project->name); |
|
$term = term_exists( $processed, 'cablecast_project' ); // array is returned if taxonomy is given |
|
if ($term == NULL) { |
|
wp_insert_term( |
|
$processed, // the term |
|
'cablecast_project', // the taxonomy |
|
array( |
|
'description' => empty($project->description) ? '' : $project->description, |
|
) |
|
); |
|
} else { |
|
wp_update_term($term['term_id'], 'cablecast_project', array( |
|
'description' => empty($project->description) ? '' : $project->description, |
|
)); |
|
} |
|
} |
|
} |
If we had a way to keep track of which terms still exist, is it safe to call wp_delete_term on any remaining terms? Is there any chance that $projects may not contain all projects in Cablecast due to a server response error?
In
cablecast_sync_projects, there is no mechanism to remove a project that has been removed on the backend.wp-cablecast/includes/sync.php
Lines 375 to 393 in bcabf82
If we had a way to keep track of which terms still exist, is it safe to call
wp_delete_termon any remaining terms? Is there any chance that$projectsmay not contain all projects in Cablecast due to a server response error?