I'm attempting to create a simple menu layout for a plugin. This is my first attempt at creating a plugin so apologies for what probably an obvious mistake here. This is the code I have to create the menu
add_action( 'admin_menu', 'register_menu_page' );
add_action( 'admin_menu', 'register_submenu_page' );
function register_menu_page()
{
add_menu_page( 'Broughton Admin', 'Broughton Admin', 'manage_options', 'broughton-admin-page', 'broughton_admin_page' );
}
function register_submenu_page() {
add_submenu_page( 'broughton-admin-page', 'Upload XML', 'Upload XML', 'manage_options', 'upload-xml-page', 'upload_xml_page' );
add_submenu_page( 'broughton-admin-page', 'Archive XML', 'Archive XML', 'manage_options', 'archive-xml-page', 'archive_xml_page' );
function broughton_admin_page()
{
echo '<p>Menu Page</p>';
}
function upload_xml_page()
{
echo '<p>Upload submenu page</p>';
}
function archive_xml_page()
{
echo '<p>Archive subment page</p>';
}
The code doesn't work, I just get a white screen when I attempt to login as an admin. The error log rather ambiguously reports: "syntax error, unexpected end of file". Can anyone see the issue here?