# propertyhive/1.4.60/includes/admin/class-ph-admin-dashboard.php

Property Hive, version 1.4.60. 81 lines.

- Page: https://pluginprobe.com/plugins/propertyhive/1.4.60/code/includes/admin/class-ph-admin-dashboard.php
- Raw: https://pluginprobe.com/plugins/propertyhive/1.4.60/raw/includes/admin/class-ph-admin-dashboard.php
- Modified: 2019-11-27T09:02:44+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/propertyhive/1.4.60/code/includes/admin/class-ph-admin-dashboard.php#L10-L20`.

```php
<?php
/**
 * Admin Dashboard
 *
 * @author      PropertyHive
 * @category    Admin
 * @package     PropertyHive/Admin
 * @version     1.0.0
 */
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}
if ( ! class_exists( 'PH_Admin_Dashboard' ) ) :

/**
 * PH_Admin_Dashboard Class.
 */
class PH_Admin_Dashboard {

	/**
	 * Hook in tabs.
	 */
	public function __construct() {
		// Only hook in admin parts if the user has admin access
		if ( current_user_can( 'manage_options' ) ) {
			add_action( 'wp_dashboard_setup', array( $this, 'init' ) );
		}
	}

	/**
	 * Init dashboard widgets.
	 */
	public function init() {
		wp_add_dashboard_widget( 'propertyhive_dashboard_news', __( 'Property Hive News', 'propertyhive' ), array( $this, 'news_widget' ) );

		if ( get_option('propertyhive_module_disabled_viewings', '') != 'yes' )
        {
        	wp_add_dashboard_widget( 'propertyhive_dashboard_viewings_awaiting_applicant_feedback', __( 'Viewings Awaiting Applicant Feedback', 'propertyhive' ), array( $this, 'viewings_awaiting_applicant_feedback_widget' ) );
        }

        if ( 
        	(
        		get_option('propertyhive_module_disabled_appraisals', '') != 'yes' &&
        		get_option('propertyhive_module_disabled_viewings', '') != 'yes'
       		)
       		|| 
       		apply_filters( 'propertyhive_show_my_upcoming_appointments_dashboard_widget', false ) === true
        )
        {
        	wp_add_dashboard_widget( 'propertyhive_dashboard_my_upcoming_appointments', __( 'My Upcoming Appointments', 'propertyhive' ), array( $this, 'my_upcoming_appointments_widget' ) );
        }
	}

	/*
	 * Property Hive News Widget
	 */
	public function news_widget()
	{
		echo '<div id="ph_dashboard_news">Loading...</div>';
	}

	/*
	 * Property Hive Viewings Awaiting Applicant Feedback Widget
	 */
	public function viewings_awaiting_applicant_feedback_widget()
	{
		echo '<div id="ph_dashboard_viewings_awaiting_applicant_feedback">Loading...</div>';
	}

	/*
	 * Property Hive My Upcoming Appointments Widget
	 */
	public function my_upcoming_appointments_widget()
	{
		echo '<div id="ph_dashboard_my_upcoming_appointments">Loading...</div>';
	}
}

endif;

return new PH_Admin_Dashboard();
```
