current_to_active

The Carbon Light - Business responsive current to active function.

Description

current_to_active( $text ); 

Parameters (1)

0. $text
The text.

Usage

  1. if ( !function_exists( 'current_to_active' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4. // The text. 
  5. $text = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = current_to_active($text); 
  9.  

Defined (1)

The function is defined in the following location(s).

/functions.php  
  1. function current_to_active($text) { 
  2. $replace = array( 
  3. // List of classes to replace with "active" 
  4. 'current_page_item' => 'active',  
  5. 'current_page_parent' => 'active',  
  6. 'current_page_ancestor' => 'active',  
  7. ); 
  8. $text = str_replace(array_keys($replace), $replace, $text); 
  9. return $text;