Support » Plugin: Mega Menu Plugin for WordPress - AP Mega Menu » Menu Replacement Settings or other solution for setting an menu item with logic

  • I thought with the Menu Replacement Settings I can add my own programming logic to a menu item.
    I set:
    Choose: Search Type
    Custom Content: [myOnwSortcode]
    (My Shortcode outputs an dynamic generated link.)
    but nothing happes. Can it be that I misunderstood this function? Or is there a documentation how can I code my own shortcode that works with your Menu Replacement Settings?

    If that not work, do you have another idea, how I can insert a menu item that use an URL, that I will generate by a function in the function.php I cannot use a static url.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello Dimizu,

    We really appreciate you writing in.

    Please follow this documentation to know about menu replacement settings https://accesspressthemes.com/documentation/ap-mega-menu/ and let us know if you still have any query.

    Thank you!

    Thread Starter dimizu

    (@dimizu)

    Maybe my English is too bad to express myself correctly. I try again:

    I know your dokumentation https://accesspressthemes.com/documentation/ap-mega-menu/ This is not the problem.

    My question is:

    With the option “Menu Replacement Settings” can I replace only Mmenu items with search form or it is possibile to replace menu item with my own code? How can do it?

    I have tried to enter my own shortcode int he field “Custom Content” but this has not worked….

    • This reply was modified 4 years, 4 months ago by dimizu.
    • This reply was modified 4 years, 4 months ago by dimizu.

    Hello there,

    Thank you for writing in.

    Sorry to tell you that currently, this is not possible. You cannot keep your own code. You can only use our mega menu shortcode that we mentioned.

    Thanks.

    Thread Starter dimizu

    (@dimizu)

    Hello,

    I understand. Thanks, for the replay.

    Now I wanted to use walker_nav_menu_start_el to chance a specific menu item. But I have seen that when your plugin is active, then the walker_nav_menu_start_el not works.

    I have exchanged walker_nav_menu_start_el with wp_mega_menu_walker_nav_menu_start_el

    This works:
    Here my exemplary code

    
    
    add_filter('wp_mega_menu_walker_nav_menu_start_el','nav_replace_menuLangLinks',10,2);
    function nav_replace_menuLangLinks($item_output, $item) {
    	
    	if ($item->title == OLDLINKTITLE) {
    		return NEWLINK;
    	}
    	else {
    		return $item_output;
    	}
    }
    

    Is this a good praxis with your plugin?

    • This reply was modified 4 years, 3 months ago by dimizu.

    Hello Dimizu,

    Thank you very much for the solution. We will fix this issue in our next update.

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Menu Replacement Settings or other solution for setting an menu item with logic’ is closed to new replies.