You are here

function search_api_exclude_add_node in Search API exclude 7

Adds an "Exclude" entry for a specific node.

Parameters

int $nid: The node's NID.

2 calls to search_api_exclude_add_node()
search_api_exclude_node_update in ./search_api_exclude.module
Implements hook_node_update().
search_api_exclude_set_status_action in ./search_api_exclude.module
Action function.

File

./search_api_exclude.module, line 187
Allows users to exclude specific nodes from indexing by Search API.

Code

function search_api_exclude_add_node($nid) {
  db_merge('search_api_exclude')
    ->fields(array(
    'nid' => $nid,
  ))
    ->condition('nid', $nid)
    ->execute();
}