wp_delete_attachment不使用多个值

时间:2016-09-27 14:24:20

标签: php jquery wordpress html5

输入附件图像ID不起作用任何人都知道可以告诉问题在哪里

table = $('#loadmaincat').DataTable({   
    "ajax" : {
        "url" : "model/productListReport.php",
        "type" : "POST",
        "data" : {
            "list" : "list",
            "dataSrc": "data",
            "type" : "all"
        }
    },
    exportOptions: {
        modifier: {
            search: 'applied',
            order: 'applied',
        }
    }
});

1 个答案:

答案 0 :(得分:0)

问题解决谢谢你@Jrod你是对的

if (isset($_POST['jfiler-items-exclude-imgid'])) {
    $string = str_replace('"', '', $_POST['jfiler-items-exclude-imgid']);
    $string1 = str_replace('\\', '', $string); 
    $string3 = str_replace('[', '', $string1);
    $string4 = str_replace(']', '', $string3);
    $att_ids = explode(',', $string4);
    foreach($att_ids as $key=>$att_id){
            wp_delete_attachment($att_id);
        }
}