<?php 
/**
 * Functions for Admin area
 */
function admin_scripts(){
	wp_register_style( 'brood_admin_style', get_template_directory_uri().'/admin/admin-style.css' );
	wp_enqueue_style( 'brood_admin_style' );
}
add_action( 'admin_enqueue_scripts', 'admin_scripts' );
/**
 * Adds a theme info page in the dashboard
 */
function brood_theme_info(){
	add_theme_page(
			'Theme Info',
			'Theme Info',
			'manage_options', 
			'theme-info', 
			'brood_theme_info_callback'
		);
}
add_action( 'admin_menu', 'brood_theme_info' );

function brood_theme_info_callback(){
	get_template_part( 'admin/template-parts/theme', 'info' );
}
/**
 * Add dashboard widget for theme
 */
function brood_dashboard_widget(){
	add_meta_box('brood_help_widget', 
				'Theme Support', 
				'brood_dashboard_widget_callback',
				'',
				'normal',
				'high'
				);
}
add_action( 'wp_dashboard_setup', 'brood_dashboard_widget' );

function brood_dashboard_widget_callback(){
	$output = '';
	$output	.=	'<p><b>Brood professional version available now! <a href="https://tidyhive.com/theme/brood-pro/" target="_blank">View Features.</a></b> </p>';
	$output .=  '<p><a href="'.get_admin_url('','themes.php?page=theme-info').'">Click here</a> to know more about the changes made in the recent update.
			</p>';
	echo $output;
}
?>