Looks you are adding pages the wrong way.
Here how it should look inside the class:
class My_Add_Menu_Pages {
public function __construct() {
add_action( 'admin_menu', array( $this, 'my_custom_admin_pages' ) );
}
public function my_custom_admin_pages() {
add_menu_page(
'Social Networks Auto Poster',
'SNAP|AutoPoster',
'haveown_snap_accss',
'nxssnap',
array(
$this,
'showPage_accounts'
)
);
add_submenu_page(
'nxssnap',
__( 'Calendar View', 'social-networks-auto-poster-facebook-twitter-g' ),
__( 'Calendar View', 'social-networks-auto-poster-facebook-twitter-g' ),
'manage_options',
'nxs-function_name',
array(
$this,
'showPage_about'
)
);
}
public function showPage_accounts() {
echo '<h1>Parent Page</h1>';
}
public function showPage_about() {
echo '<h1>Child Page</h1>';
}
}
new My_Add_Menu_Pages;