includes(); /** * Load admin assets. */ add_action( 'admin_enqueue_scripts', array( $this, 'load_assets' ) ); } /** * Includes files. */ private function includes() { /** * Include Gautam welcome page. */ require_once dirname( __FILE__ ) . '/class-gautam-dashboard.php'; // phpcs:ignore } /** * Load our required assets on admin pages. * * @param string $hook it holds the information about the current page. */ public function load_assets( $hook ) { /** * Do not enqueue in case of no admin pages. */ if ( ! $this->is_admin_page() ) { return; } /** * Enqueue admin pages stylesheet. */ wp_enqueue_style( 'gautam-admin-styles', get_parent_theme_file_uri() . '/inc/admin/css/gautam-admin.css', false, '1.1.0' ); } /** * Check if we're on a Gautam admin page. * * @return boolean */ public function is_admin_page() { $base = get_current_screen()->base; return false !== strpos( $base, 'gautam' ); } } endif; new Gautam_Admin();