You are here

function html_title_nodeapi in HTML Title 6

Implementation of hook_nodeapi()

File

./html_title.module, line 82
This module enables limited HTML to be used in node titles. It strips title markup from RSS feeds to eliminate unsightly markup in feed readers.

Code

function html_title_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  switch ($op) {
    case 'load':

      // Capture original title for use in hook_preprocess_node
      return array(
        'html_title_raw' => $node->title,
      );
      break;
    case 'rss item':

      // Strip html from titles
      $node->title = strip_tags($node->title);
      break;
    case 'view':

    // Strip html from titles for views feeds using 'node' rendering
    case 'alter':

      // Strip html from titles for views feeds using other rendering
      if ($node->build_mode == NODE_BUILD_RSS) {
        $node->title = strip_tags($node->title);
      }
      break;
  }
}