public function delete_service($service_id)
{
$options = get_option('sharing-options');
if (isset($options[$service_id])) {
unset($options[$service_id]);
}
$key = array_search($service_id, $options['global']['custom']);
if ($key !== false) {
unset($options['global']['custom'][$key]);
}
update_option('sharing-options', $options);
return true;
}
public function ajax_delete_service() { if (isset($_POST['_wpnonce']) && isset($_POST['service']) && wp_verify_nonce($_POST['_wpnonce'], 'sharing-options_' . $_POST['service'])) { $sharer = new Sharing_Service(); $sharer->delete_service($_POST['service']); } }