|
@@ 522-528 (lines=7) @@
|
| 519 |
|
|
| 520 |
|
if (isset($_POST[$value['id'] . '_remove']) && $_POST[$value['id'] . '_remove']) {// if remove is set then remove the file
|
| 521 |
|
|
| 522 |
|
if (get_option($value['id'])) {
|
| 523 |
|
$image_name_arr = explode('/', get_option($value['id']));
|
| 524 |
|
$noimg_name = end($image_name_arr);
|
| 525 |
|
$img_path = $uploads['path'] . '/' . $noimg_name;
|
| 526 |
|
if (file_exists($img_path))
|
| 527 |
|
unlink($img_path);
|
| 528 |
|
}
|
| 529 |
|
|
| 530 |
|
update_option($value['id'], '');
|
| 531 |
|
}
|
|
@@ 550-556 (lines=7) @@
|
| 547 |
|
|
| 548 |
|
$uploads = wp_upload_dir();
|
| 549 |
|
|
| 550 |
|
if (get_option($value['id'])) {
|
| 551 |
|
$image_name_arr = explode('/', get_option($value['id']));
|
| 552 |
|
$noimg_name = end($image_name_arr);
|
| 553 |
|
$img_path = $uploads['path'] . '/' . $noimg_name;
|
| 554 |
|
if (file_exists($img_path))
|
| 555 |
|
unlink($img_path);
|
| 556 |
|
}
|
| 557 |
|
|
| 558 |
|
$upload_overrides = array('test_form' => false);
|
| 559 |
|
$movefile = wp_handle_upload($uplaods, $upload_overrides);
|