responsive_wp_page_menu

Removes div from wp_page_menu() and replace with ul.

Description

responsive_wp_page_menu( $page_markup ); 

Parameters (1)

0. $page_markup
The page markup.

Usage

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

Defined (1)

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

/includes/functions.php  
  1. function responsive_wp_page_menu ($page_markup) { 
  2. preg_match('/^<div class=\"([a-z0-9-_]+)\">/i', $page_markup, $matches); 
  3. $divclass = $matches[1]; 
  4. $replace = array('<div class="'.$divclass.'">', '</div>'); 
  5. $new_markup = str_replace($replace, '', $page_markup); 
  6. $new_markup = preg_replace('/^<ul>/i', '<ul class="'.$divclass.'">', $new_markup); 
  7. return $new_markup; }