includes(); /** * Load admin assets. */ add_action( 'admin_enqueue_scripts', array( $this, 'load_assets' ) ); /** * Admin page header. */ add_action( 'in_admin_header', array( $this, 'admin_header' ), 100 ); /** * Add notices. */ add_action( 'admin_notices', array( $this, 'admin_notices' ) ); /** * After admin loaded */ do_action( 'business_assistant_admin_loaded' ); } /** * Includes files. * * @since 1.0.0 */ private function includes() { /** * Include helper functions. */ require_once BUSINESS_ASSISTANT_THEME_PATH . '/core/includes/admin/helpers.php'; // phpcs:ignore /** * Include welcome page. */ require_once BUSINESS_ASSISTANT_THEME_PATH . '/core/includes/admin/class-mi-dashboard.php'; // phpcs:ignore } /** * Load our required assets on admin pages. * * @since 1.0.0 * @param string $hook it holds the information about the current page. */ public function load_assets( $hook ) { /** * Do not enqueue if we are not on one of our pages. */ if ( ! business_assistant_is_admin_page( $hook ) ) { return; } // Script debug. $prefix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? 'dev/' : ''; $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; /** * Enqueue admin pages script. */ wp_enqueue_script( 'business-assistant-admin-script', BUSINESS_ASSISTANT_THEME_URI . '/core/includes/admin/assets/js/dev/' . $prefix . 'business-assistant-admin' . $suffix . '.js', array( 'jquery', 'wp-util', 'updates' ), BUSINESS_ASSISTANT_THEME_VERSION, true ); } /** * Outputs the page admin header. * * @since 1.0.0 */ public function admin_header() { $base = get_current_screen()->base; if ( ! business_assistant_is_admin_page( $base ) ) { return; } ?>
base, array( 'dashboard', 'themes' ), true ) && ! business_assistant_is_admin_page() ) { return; } } } endif;