Advertisement
Guest User

Polylang frontend-nav-menu.php fix

a guest
Nov 18th, 2013
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. /* throws warning */
  2.     public function nav_menu_locations($menus) {
  3.         if (is_array($menus))
  4.             $theme = get_option('stylesheet');
  5.  
  6.             foreach ($menus as $loc => $menu) {
  7.                 if (!empty($this->options['nav_menus'][$theme][$loc][$this->curlang->slug]))
  8.                     $menus[$loc] = $this->options['nav_menus'][$theme][$loc][$this->curlang->slug];
  9.             }
  10.  
  11.         return $menus;
  12.     }
  13. /* no warnings */
  14.     public function nav_menu_locations($menus) {
  15.         if (is_array($menus)) {
  16.             $theme = get_option('stylesheet');
  17.  
  18.             foreach ($menus as $loc => $menu) {
  19.                 if (!empty($this->options['nav_menus'][$theme][$loc][$this->curlang->slug]))
  20.                     $menus[$loc] = $this->options['nav_menus'][$theme][$loc][$this->curlang->slug];
  21.             }
  22.         }
  23.         return $menus;
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement