You are here

function xbbcode_custom_tag_exists in Extensible BBCode 7

Same name and namespace in other branches
  1. 8 xbbcode.crud.inc \xbbcode_custom_tag_exists()
  2. 8.2 xbbcode.crud.inc \xbbcode_custom_tag_exists()

Check if a custom tag with a certain name exists.

Parameters

$name: The tag name for which to search.

Return value

1 if it exists, 0 if it does not.

1 call to xbbcode_custom_tag_exists()
xbbcode_custom_tags_validate in ./xbbcode.admin.inc
Validation of the custom tags form.

File

./xbbcode.crud.inc, line 17
Data interface for creating, reading, updating and deleting records.

Code

function xbbcode_custom_tag_exists($name) {
  $query = db_select('xbbcode_custom_tag', 'tag')
    ->fields('tag')
    ->condition('name', $name)
    ->countQuery()
    ->execute()
    ->fetchCol(0);
  return $query[0];
}