Remove value from array within post meta ajax admin
You’re not printing anything from the AJAX callback. Trying using wp_send_json_success: function ajaxtestdel(){ global $post; $currentPdfs = get_post_meta( $post->ID, ‘pdf_upload_url’, true ); $postValue = isset($_POST[‘postid’]) ? $_POST[‘postid’] : ”; $array_without_strawberries = array_diff($currentPdfs, array($postValue)); update_post_meta( $post->ID, ‘pdf_upload_url’, $array_without_strawberries ); // Send something back to AJAX wp_send_json_success(); } I have a feeling that perhaps your jQuery selector … Read more