custom module in user
Set the menu_name key of your menu-router item. From the docs:


  menu_name: Optional. Set this to a custom menu if you don't want your item to be placed in Navigation.


By default the primary links are set to the Main menu (machine name: main-menu). Therefore use something like this in your implementation of hook_menu:

function hook_menu() {
  $items['example'] = array(
    'title' =&gt; 'Example Page',
    'page callback' =&gt; 'example_page',
    'access arguments' =&gt; array('access content'),
    'type' =&gt; MENU_NORMAL_ITEM,
    'menu_name' =&gt; 'main-menu',
  );
  return $items;
}