get_version(); $assets_dir = charitable()->get_path( 'assets', false ); $dependencies = array( 'jquery' ); wp_enqueue_style( 'charitable-admin-getting-started', charitable()->get_path( 'assets', false ) . "css/admin/charitable-admin-getting-started{$min}.css", null, $style_version ); wp_enqueue_style( 'jquery-confirm', charitable()->get_path( 'directory', false ) . 'assets/lib/jquery.confirm/jquery-confirm.min.css', null, '3.3.4' ); wp_enqueue_style( 'charitable-font-awesome', charitable()->get_path( 'directory', false ) . 'assets/lib/font-awesome/font-awesome.min.css', null, '4.7.0' ); wp_enqueue_script( 'jquery-confirm', charitable()->get_path( 'directory', false ) . 'assets/lib/jquery.confirm/jquery-confirm.min.js', array( 'jquery' ), '3.3.4', false ); wp_register_script( 'charitable-admin-2.0', $assets_dir . 'js/admin/charitable-admin-2.0.js', $dependencies, $script_version, false ); wp_enqueue_script( 'charitable-admin-2.0' ); } /** * Register all WP hooks. * * @since 1.8.1.12 */ public function hooks() { // If user is in admin ajax or doing cron, return. if ( wp_doing_ajax() || wp_doing_cron() ) { return; } // If user cannot manage_options, return. if ( ! charitable_current_user_can( 'administrator' ) ) { return; } add_action( 'admin_menu', array( $this, 'register' ) ); add_action( 'admin_head', array( $this, 'hide_menu' ) ); } /** * Register the pages to be used for the Getting_Started screen (and tabs). * * These pages will be removed from the Dashboard menu, so they will * not actually show. Sneaky, sneaky. * * @since 1.8.1.12 */ public function register() { // Getting started - shows after installation. add_dashboard_page( esc_html__( 'Welcome to Charitable', 'charitable' ), esc_html__( 'Welcome to Charitable', 'charitable' ), 'manage_charitable_settings', // phpcs:ignore self::SLUG, array( $this, 'output' ) ); } /** * Removed the dashboard pages from the admin menu. * * This means the pages are still available to us, but hidden. * * @since 1.8.1.12 */ public function hide_menu() { remove_submenu_page( 'index.php', self::SLUG ); } /** * Getting Started screen. Shows after first install. * * @since 1.8.1.12 */ public function output() { $class = charitable_is_pro() ? 'pro' : 'lite'; // get first name of logged in user... $first_name = get_user_meta( get_current_user_id(), 'first_name', true ); if ( ! empty( $first_name ) ) { $first_name = esc_html__( 'Hi', 'charitable' ) . ' ' . $first_name . '! '; } $stripe_connect_url = false; $gateway_mode = false; // check if class exists... if ( class_exists( 'Charitable_Gateway_Stripe_AM' ) ) { $stripe_gateway = new Charitable_Gateway_Stripe_AM(); $redirect_url = admin_url( 'admin.php?page=charitable-getting-started&step=continue' ); $stripe_connect_url = $stripe_gateway->get_stripe_connect_url( $redirect_url ); $stripe_connected = $stripe_gateway->maybe_stripe_connected(); $gateway_mode = ( charitable_get_option( 'test_mode' ) ) ? 'test' : 'live'; } ?>

199