• Resolved edugarlao

    (@edugarlao)


    I need to solve this problem that I have with viewing the web cast Vertical Menu with WordPress and Artisteer 4.1

    I detail the error …

    Warning: in_array() expects parameter 2 to be array, null given in /homepages/5/d475808735/htdocs/web/wp-content/plugins/polylang/include/nav-menu.php on line 233

    Warning: in_array() expects parameter 2 to be array, null given in /homepages/5/d475808735/htdocs/web/wp-content/plugins/polylang/include/nav-menu.php on line 237

    And here the code that indicates the error in nav-menus.php

    232 foreach ($items as $item) {
    233 if (in_array(‘current-lang’, $item->classes)) {
    234 $item->classes = array_diff($item->classes, array(‘current-menu-item’));
    235 $r_ids = array_merge($r_ids, $this->get_ancestors($item)); // remove the classes for these ancestors
    236 }
    237 elseif (in_array(‘current-menu-item’, $item->classes))
    238 $k_ids = array_merge($k_ids, $this->get_ancestors($item)); // keep the classes for these ancestors
    239 }

    Thanks,

    http://wordpress.org/extend/plugins/polylang/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Chouby

    (@chouby)

    Thanks for the report. The current development version should correct this issue.
    http://downloads.wordpress.org/plugin/polylang.zip

    Thread Starter edugarlao

    (@edugarlao)

    Thanks for the correction of the error, continue betting big on the development of this plugin.

    Greetings Chouby

    I need help with changing php code on my page.
    I don’t know php, so I would very much appreciate if you could tell me what the broken code should look like, because I do not know, waht to delete, what to keep 🙁

    // remove current-menu and current-menu-ancestor classes to lang switcher when not on the home page
    	function wp_nav_menu_objects($items) {
    		$r_ids = $k_ids = array();
    
    		foreach ($items as $item) {
    			if (in_array('current-lang', $item->classes)) {
    				$item->classes = array_diff($item->classes, array('current-menu-item'));
    				$r_ids = array_merge($r_ids, $this->get_ancestors($item)); // remove the classes for these ancestors
    			}
    			elseif (in_array('current-menu-item', $item->classes))
    				$k_ids = array_merge($k_ids, $this->get_ancestors($item)); // keep the classes for these ancestors

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Please help and show me the correct code, I should insert in my nav-menu.php file.
    Thanks!

    Oh, never mind, I downloaded the development version, from the zip file and replaced the nav-menu.php with the new one and everything works fine !!
    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Polylang Artisteer, bug in navmenus.php’ is closed to new replies.