function change_menu($items){
  foreach($items as $item){
    if( $item->title == "Log Out"){
         $item->url = $item->url . "&_wpnonce=" . wp_create_nonce( 'log-out' );
    }
  }
  return $items;

}
add_filter('wp_nav_menu_objects', 'change_menu');

Leave a Comment