You are here

function nodewords_basic_robots_prepare in Nodewords: D6 Meta Tags 6.3

Same name and namespace in other branches
  1. 6 nodewords_basic/nodewords_basic.module \nodewords_basic_robots_prepare()
  2. 6.2 nodewords_basic/includes/nodewords_basic.nodewords.tags.inc \nodewords_basic_robots_prepare()

Set the meta tag content.

File

nodewords_basic/includes/nodewords_basic.nodewords.tags.inc, line 286
Meta tags definition file.

Code

function nodewords_basic_robots_prepare(&$tags, $content, $options) {
  if ($options['type'] == NODEWORDS_TYPE_PAGER) {
    $index_follow = variable_get('nodewords_list_robots_index_follow', 'noindex,nofollow');
    $robots = variable_get('nodewords_list_robots_value', array());
    $value = explode(',', $index_follow);
    $value = array_merge($value, !empty($robots) ? array_values(array_filter($robots)) : array());
  }
  else {
    $value = !empty($content['index_follow']) ? explode(',', $content['index_follow']) : array(
      'noindex',
      'nofollow',
    );
    $value = array_merge($value, !empty($content['value']) ? array_values(array_filter($content['value'])) : array());
  }
  if (!empty($value)) {
    $tags['robots'] = implode(',', $value);
  }
}