You are here

function patterns_db_unpublish_pattern in Patterns 7.2

Same name and namespace in other branches
  1. 7 includes/ \patterns_db_unpublish_pattern()

Sets the flag public to FALSE in the database for the pattern with the specified pattern id.


mixed $pattern A pattern object, an array representing: the pattern object, a numeric id or alphanumeric name of the pattern as it is in the database

Return value

Bool TRUE, if successful

2 calls to patterns_db_unpublish_pattern()
drush_patterns_unpublish in ./
patterns unpublish command callback.
patterns_unpublish_pattern_submit in includes/
Executes patterns_db_unpublish_pattern($pid) and display a message.


includes/, line 498
Retrieve, save, and remove patterns from the database.


function patterns_db_unpublish_pattern($pattern) {
  $pattern = _patterns_db_get_pattern($pattern);
  if (!$pattern) {
    return FALSE;
  $pid = $pattern->pid;
  return db_query("UPDATE {patterns} SET public = 0 WHERE pid = :pid", array(
    'pid' => $pid,