shortcut_set_title_exists

shortcut_set_title_exists($title)

Check to see if a shortcut set with the given title already exists.

Parameters

$title: Human-readable name of the shortcut set to check.

Return value

TRUE if a shortcut set with that title exists; FALSE otherwise.

Deprecated

in Drupal 8.x, will be removed before Drupal 9.0.

File

core/modules/shortcut/shortcut.module, line 234
Allows users to manage customizable lists of shortcut links.

Code

function shortcut_set_title_exists($title) {
  $sets = ShortcutSet::loadMultiple();
  foreach ($sets as $set) {
    if ($set->label() == $title) {
      return TRUE;
    }
  }
  return FALSE;
}
doc_Drupal
2016-10-29 09:43:01
Comments
Leave a Comment

Please login to continue.