Can be changed using filter
add_filter('wp_get_nav_menu_items', 'add_utm_to_links', 10, 3);
function add_utm_to_links($items, $menu, $args) {
foreach($items as $item) {
if(!empty($item->url)) {
$item->url .= strchr($url, '?') === false ? '?' : '&';
$item->url .= 'utm=value';
}
}
return $items;
}
Related Posts:
- Add settings to menu items in the Customizer
- Using string instead of object class instantiation on the walker argument breaks wp_nav_menu
- Remove ‘Menus’ from Twenty Sixteen theme Customizer
- Remove nav_menus from customizer using a theme
- Partial refresh of menu in customizer not working?
- Different fields available for different sites when when customising Menu’s
- Add media library items to Menus using the Customizer (via Media Manager not URL)
- How to customize submenus isn wordpress theme [closed]
- How to re-arrange the MENU of “Allure Real Estate Theme for Placester” wordpress theme?
- Can’t add a setting to the “nav_menus” customizer panel
- Making the menu toggled open on mobile devices Illustratr theme
- Custom link with checkbox that adds additional word to checked menu items
- How to work with a custom theme that someone else created before me? (details below)
- use value returned from shortcode as menu item
- WP Menu editor is hiding options for menu items
- WordPress Menu Customizer
- Problems with draft website pages
- Retrieving a list of menu items in an array
- Error: Declaration of MyClass::start_lvl() should be compatible with that of Walker_Nav_Menu::start_lvl()
- Filter out built-in wp_nav_menu classes but keep custom class
- remove last separator?
- How to get a different mobile menu than desktop menu in the twentytwelve child theme
- WordPress built in breadcrumb trail menu?
- Custom Nav Walker menu – Display children count
- WordPress Export Import Site Navigation Menu
- Bar separated navigation by extending Walker_Nav_Menu
- insert element inside wp menu list item
- WordPress Menu Disappears when $query->query_vars[‘meta_key’] is set
- how do I delete (not exclude) a menu item from navigation bar
- show only a given level in nav menu
- Custom menus created but does not show up in admin panel
- Replace menu tag with tag
- How to display custom post meta in the appearance->menus page
- How to style current page menu item when using a walker
- Anchor only wp_nav_menu
- wp_nav_menu custom walker – child items
- Where do custom menus get constructed?
- Keeping ‘current-menu-item’ highlight of navigation menu?
- Does loading of sub pages in menu cause load to the server?
- Get admin menu link
- Possible to add a dynamic link to a sub-menu via wp_nav_menu_items?
- Count top level menu items
- How can I access the menu ID of an element in a WordPress Nav_Walker
- Fragment URL in navigation item without a custom link
- Unable to create or edit menus
- wp-admin is blocking my mobile menu icon [closed]
- Filtering Only a Specific Menu using the “add_additional_class_in_li”?
- Displaying primary nav menu two ways
- How to Implement Submenu Using wp_nav_menu
- Close dropdown menu on click or scroll outside the menu [closed]
- How to have the Header show different content on different pages?
- WordPress menu not loading in the admin side appearence-> menu tab
- Is there no straightforward way to display a separate second level using wp_nav_menu()?
- Uber menu, manual integration, disable Mobile
- CSS_Menu_Walker not showing on mobile view?
- Drag and drop isn’t working while creating menu
- Change the menu home link to something else
- wp_nav_menu $theme_location parameter ignored
- Make pages visible to only logged in members
- Insert a div before the wp_nav_menu
- How to use wp_nav_menu with hashtag links?
- Rename menu items for All except super admin
- Get Menus In Header.php FIle
- Add custom link on the fly to nav menu
- Custom register_taxonomy ins’t showing custom Nav menu
- Conditional menus based on page title
- How to test if a specific page is the front page?
- URL links consistent with menus?
- Strange menu behaviour wordpress admin [duplicate]
- Menu deletes all items and position – wordpress bug?
- changing the labels inside appearance -> menus for some for the fields
- Lost admin “manage_link” capability WordPress. No “Links” menu item in admin menu
- How to add active class to separate page link?
- dropdown menu, with walker
- Add function to custom menu
- Menu item that hides when you click the previous submenu
- How to get the Page Name of the current page?
- Add/remove image from navigation bar
- Swap out a page that is a parent to a many many pages
- How can I order these pages in this navigation bar on this old wordpress theme?
- Modifying Woocommerce menu based on tags and categories
- Add href to tag in nav menu for mobile
- How to change navwalker’s dropdown mark-up?
- Bootstrap navbar responsiveness on WordPress theme menu not working
- Creating custom vertical menu
- Enable identical menu on network sites
- Show navigation header menu by post and categery
- How to add buddypress sub-menu items to other menus
- Custom location for menu
- No indication of menu
- How to select single category in menu if post have two categories?
- menu is only pulling in one item
- How to get current menu item “CSS Classes” value?
- Set menu item class into body
- How to add drop down sub menu from database fields in the particular menu slug
- Creating a custom menu
- List WordPress Custom Menu’s active parent level’s children as separate menu
- How to create a custom WordPress navigation menu?
- Add acf custom fields so sub item in menus
- change breakpoint widths for divi theme tablet view