/**
* Delete a single mapping
*
* ## OPTIONS
*
* <id>
* : Mapping ID
*/
public function delete($args)
{
$mapping = Mapping::get($args[0]);
if (empty($mapping)) {
$mapping = new WP_Error('mercator.cli.mapping_not_found', __('Invalid mapping ID', 'mercator'));
}
if (is_wp_error($mapping)) {
return WP_CLI::error($mapping->get_error_message());
}
$result = $mapping->delete();
if (empty($result) || is_wp_error($result)) {
return WP_CLI::error(__('Could not delete mapping', 'mercator'));
}
}