You are here

function custom_breadcrumbs_taxonomy_menu_alter in Custom Breadcrumbs 6.2

Implements hook_menu_alter().

File

custom_breadcrumbs_taxonomy/custom_breadcrumbs_taxonomy.module, line 165
This module implements taxonomy_based breadcrumbs using a hybrid of methods developed for the custom_breadcrumbs and taxonomy_breadcrumbs modules. Breadcrumbs are provided for node and taxonomy term pages. If 'Use taxonomy hierarchy' is…

Code

function custom_breadcrumbs_taxonomy_menu_alter(&$callbacks) {

  // This will not work if views or panels has overriden taxonomy/term/%
  if (isset($callbacks['taxonomy/term/%']) && $callbacks['taxonomy/term/%']['page callback'] != 'views_page') {
    $term_callback =& $callbacks['taxonomy/term/%'];
    $callback = $term_callback['page callback'];
    $arguments = $term_callback['page arguments'];
    $file = $term_callback['file'];
    $filepath = isset($term_callback['file path']) ? $term_callback['file path'] : drupal_get_path('module', $term_callback['module']);
    $term_callback['page callback'] = 'custom_breadcrumbs_taxonomy_term_page';
    $term_callback['page arguments'] = array_merge(array(
      2,
      $callback,
      $file,
      $filepath,
    ), $arguments);
    $term_callback['file'] = 'custom_breadcrumbs_taxonomy.inc';
    $term_callback['file path'] = drupal_get_path('module', 'custom_breadcrumbs_taxonomy');
  }
}