title: Add custom data-attribute to Wordpress navigation menu
body: <p>I've seen some similar questions here on stackoverflow, but mine is a bit different..</p>
  
  <p>I need to be able to add custom data attribute to wordpress menu.
  The problem i've got is that all the solutions i found, like the following, for example:</p>
  
  <pre><code>add_filter( 'nav_menu_link_attributes', 'my_nav_menu_attribs', 10, 3 );
  function my_nav_menu_attribs( $atts, $item, $args )
  {
    // The ID of the target menu item
    $menu_target = 365;
  
    // inspect $item
    if ($item-&gt;ID == $menu_target) {
      $atts['data-reveal-id'] = 'myModal';
    }
    return $atts;
  }
  </code></pre>
  
  <p>allows you to add the same attribute to all menu items.
  What i need, is actually a way to add the same data attribute, but with different values on each element on the list.</p>
  
  <p>this is pretty much what i need to achive:</p>
  
  <pre><code>&lt;ul id="myMenu"&gt;
      &lt;li data-menuanchor="firstPage" class="active"&gt;&lt;a href="#firstPage"&gt;First section&lt;/a&gt;&lt;/li&gt;
      &lt;li data-menuanchor="secondPage"&gt;&lt;a href="#secondPage"&gt;Second section&lt;/a&gt;&lt;/li&gt;
      &lt;li data-menuanchor="thirdPage"&gt;&lt;a href="#thirdPage"&gt;Third section&lt;/a&gt;&lt;/li&gt;
      &lt;li data-menuanchor="fourthPage"&gt;&lt;a href="#fourthPage"&gt;Fourth section&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>because i need to use this plugin here: <a href="https://github.com/alvarotrigo/fullPage.js#fullpagejs" rel="noreferrer">https://github.com/alvarotrigo/fullPage.js#fullpagejs</a></p>
  
  <p>any advice?</p>
  
  <p>Thanks</p>