Here you go.
Since you already have the menu-id all you need is:
$menu_item_defaults = array(
'menu-item-db-id' => $menu_item_db_id,
'menu-item-object-id' => 0,
'menu-item-object' => '',
'menu-item-parent-id' => 0,
'menu-item-position' => 1,
'menu-item-title' => 'Play Game',
'menu-item-url' => '',//not sure is a blank is ok here
'menu-item-description' => '',
'menu-item-attr-title' => '',
'menu-item-target' => '',
'menu-item-classes' => '',
'menu-item-xfn' => '',
'menu-item-status' => 'publish',
);
wp_update_nav_menu_item('primary-menu', 0, $menu_item_defaults);
However, it you’re trying to speed deployment of a site with known content try it this way. You can create the page and add it to the menu all on the fly.
In my case I’m creating a custom menu first but you can use this to get the id of any menu.
$menu_exists = wp_get_nav_menu_object( 'Public Menu' );
if ( $menu_exists === false ) {
$var_pub_menu_id = wp_create_nav_menu( 'Public Menu' );
} else {
$var_pub_menu_id = $menu_exists->term_id;
}
Then I create my page and add it to the menu:
$default_fgpsn_page = array(
'post_title' => $fgpsn_default_pages[$j],//any page title. I'm working in a loop here
'post_status' => 'publish',
'post_type' => 'page',
'post_content' => 'Property Browse Short Code',//this can even be a shortcode
'post_author' => 1
);
$default_fgpsn_page_id = wp_insert_post( $default_fgpsn_page );
$menu_item_defaults = array(
//'menu-item-db-id' => $menu_item_db_id,
//'menu-item-object-id' => 0,
//'menu-item-object' => '',
'menu-item-parent-id' => 0,
'menu-item-position' => 1,
'menu-item-title' => $fgpsn_default_pages[$j],
'menu-item-url' => get_page_link( $default_fgpsn_page_id ),
'menu-item-description' => 'public properties listing',
'menu-item-attr-title' => '',
'menu-item-target' => '',
'menu-item-classes' => '',
'menu-item-xfn' => '',
'menu-item-status' => 'publish',
);
wp_update_nav_menu_item($var_pub_menu_id, 0, $menu_item_defaults);