function token_custom_delete in Custom Tokens 7
Same name and namespace in other branches
- 7.2 token_custom.module \token_custom_delete()
Delete an individual token from the database.
Parameters
$machine_name:
1 call to token_custom_delete()
File
- ./
token_custom.module, line 261 - It gives the user the ability to create custom tokens using PHP code for specific replacements that can improve other modules relying on the token Drupal 7 core API.
Code
function token_custom_delete($machine_name) {
if (!is_string($machine_name) || empty($machine_name)) {
return FALSE;
}
$return = db_delete('token_custom')
->condition('machine_name', $machine_name)
->execute();
//Clear the Token module's token cache table.
if (module_exists('token')) {
token_clear_cache();
}
return $return;
}