manageCap(), 'give-setup', [$this, 'render_page'] ); } /** * Enqueue scripts and styles. * * @since 2.8.0 */ public function enqueue_scripts() { if (!isset($_GET['page']) || 'give-setup' !== $_GET['page']) { return; } wp_enqueue_style( 'give-admin-setup-style', GIVE_PLUGIN_URL . 'build/assets/dist/css/admin-setup.css', [], GIVE_VERSION ); wp_enqueue_style('givewp-admin-fonts'); wp_enqueue_script( 'give-admin-setup-script', GIVE_PLUGIN_URL . 'build/assets/dist/js/admin-setup.js', ['jquery'], GIVE_VERSION, $in_footer = true ); wp_enqueue_script( 'give-admin-add-ons-script', GIVE_PLUGIN_URL . 'build/assets/dist/js/admin-add-ons.js', ['jquery'], GIVE_VERSION, $in_footer = true ); $localized_data = [ 'notices' => [ 'invalid_license' => __( 'Sorry, you entered an invalid key.', 'give' ), 'download_file' => __( 'Success! You have activated your license key and are receiving updates and priority support. Click here to download your add-on.', 'give' ), 'addon_activated' => __( '{pluginName} add-on activated successfully.', 'give' ), 'addon_activation_error' => __( 'The add-on did not activate successfully.', 'give' ), ], ]; wp_localize_script( 'give-admin-add-ons-script', 'give_addon_var', $localized_data ); } /** * Render the submenu page * * @since 2.8.0 */ public function render_page() { $view = give()->make(PageView::class); echo $view->render(); } }