.circleci
assets
bin
data
inc
admin-pages
customer-panel
class-account-admin-page.php
class-add-new-site-admin-page.php
class-checkout-admin-page.php
class-my-sites-admin-page.php
class-template-switching-admin-page.php
debug
class-about-admin-page.php
class-base-admin-page.php
class-base-customer-facing-admin-page.php
class-broadcast-edit-admin-page.php
class-broadcast-list-admin-page.php
class-checkout-form-edit-admin-page.php
class-checkout-form-list-admin-page.php
class-customer-edit-admin-page.php
class-customer-list-admin-page.php
class-customizer-admin-page.php
class-dashboard-admin-page.php
class-discount-code-edit-admin-page.php
class-discount-code-list-admin-page.php
class-domain-edit-admin-page.php
class-domain-list-admin-page.php
class-edit-admin-page.php
class-email-edit-admin-page.php
class-email-list-admin-page.php
class-email-template-customize-admin-page.php
class-event-list-admin-page.php
class-event-view-admin-page.php
class-hosting-integration-wizard-admin-page.php
class-invoice-template-customize-admin-page.php
class-jobs-list-admin-page.php
class-list-admin-page.php
class-membership-edit-admin-page.php
class-membership-list-admin-page.php
class-migration-alert-admin-page.php
class-payment-edit-admin-page.php
class-payment-list-admin-page.php
class-placeholders-admin-page.php
class-product-edit-admin-page.php
class-product-list-admin-page.php
class-settings-admin-page.php
class-setup-wizard-admin-page.php
class-shortcodes-admin-page.php
class-site-edit-admin-page.php
class-site-list-admin-page.php
class-system-info-admin-page.php
class-tax-rates-admin-page.php
class-template-previewer-customize-admin-page.php
class-top-admin-nav-menu.php
class-view-logs-admin-page.php
class-webhook-edit-admin-page.php
class-webhook-list-admin-page.php
class-wizard-admin-page.php
api
builders
checkout
compat
contracts
country
database
debug
deprecated
development
domain-mapping
duplication
exception
functions
gateways
helpers
installers
integrations
internal
invoices
limitations
limits
list-tables
loaders
managers
mercator
models
next
objects
site-templates
sso
tax
traits
ui
updater
class-admin-notices.php
class-admin-themes-compatibility.php
class-ajax.php
class-api.php
class-async-calls.php
class-autoloader.php
class-cron.php
class-current.php
class-dashboard-statistics.php
class-dashboard-widgets.php
class-documentation.php
class-domain-mapping.php
class-faker.php
class-geolocation.php
class-helper.php
class-hooks.php
class-license.php
class-light-ajax.php
class-logger.php
class-maintenance-mode.php
class-newsletter.php
class-requirements.php
class-scripts.php
class-session-cookie.php
class-settings.php
class-sunrise.php
class-user-switching.php
class-views.php
class-whitelabel.php
class-wp-ultimo.php
lang
patches
tests
utils
views
.gitignore
.phpcs.xml.dist
LICENSE
autoload.php
composer.json
composer.lock
constants.php
loco.xml
package-lock.json
package.json
phpstan.neon.dist
phpunit.xml.dist
readme.txt
rector.php
setuptest.sh
sunrise.php
uninstall.php
wp-multisite-waas.php
* Update translation text domain * Escape everything that should be escaped. * Add nonce checks where needed. * Sanitize all inputs. * Apply Code style changes across the codebase. * Correct many deprecation notices. * Optimize load order of many filters. * Add Proper Build script * Use emojii flags * Fix i18n deprecation notice for translating too early * Put all scripts in footer and load async
187 lines
3.7 KiB
PHP
187 lines
3.7 KiB
PHP
<?php
|
|
/**
|
|
* WP Multisite WaaS Customer Checkout Admin Page.
|
|
*
|
|
* @package WP_Ultimo
|
|
* @subpackage Admin_Pages
|
|
* @since 2.0.0
|
|
*/
|
|
|
|
namespace WP_Ultimo\Admin_Pages\Customer_Panel;
|
|
|
|
// Exit if accessed directly
|
|
defined('ABSPATH') || exit;
|
|
|
|
/**
|
|
* WP Multisite WaaS Dashboard Admin Page.
|
|
*/
|
|
class Checkout_Admin_Page extends \WP_Ultimo\Admin_Pages\Base_Customer_Facing_Admin_Page {
|
|
|
|
/**
|
|
* Holds the ID for this page, this is also used as the page slug.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $id = 'wu-checkout';
|
|
|
|
/**
|
|
* Is this a top-level menu or a submenu?
|
|
*
|
|
* @since 1.8.2
|
|
* @var string
|
|
*/
|
|
protected $type = 'submenu';
|
|
|
|
/**
|
|
* Is this a top-level menu or a submenu?
|
|
*
|
|
* @since 1.8.2
|
|
* @var string
|
|
*/
|
|
protected $parent = 'none';
|
|
|
|
/**
|
|
* This page has no parent, so we need to highlight another sub-menu.
|
|
*
|
|
* @since 2.0.0
|
|
* @var string
|
|
*/
|
|
protected $highlight_menu_slug = 'account';
|
|
|
|
/**
|
|
* If this number is greater than 0, a badge with the number will be displayed alongside the menu title
|
|
*
|
|
* @since 1.8.2
|
|
* @var integer
|
|
*/
|
|
protected $badge_count = 0;
|
|
|
|
/**
|
|
* Holds the admin panels where this page should be displayed, as well as which capability to require.
|
|
*
|
|
* To add a page to the regular admin (wp-admin/), use: 'admin_menu' => 'capability_here'
|
|
* To add a page to the network admin (wp-admin/network), use: 'network_admin_menu' => 'capability_here'
|
|
* To add a page to the user (wp-admin/user) admin, use: 'user_admin_menu' => 'capability_here'
|
|
*
|
|
* @since 2.0.0
|
|
* @var array
|
|
*/
|
|
protected $supported_panels = [
|
|
'user_admin_menu' => 'read',
|
|
'admin_menu' => 'read',
|
|
];
|
|
|
|
/**
|
|
* Should we hide admin notices on this page?
|
|
*
|
|
* @since 2.0.0
|
|
* @var boolean
|
|
*/
|
|
protected $hide_admin_notices = true;
|
|
|
|
/**
|
|
* Should we force the admin menu into a folded state?
|
|
*
|
|
* @since 2.0.0
|
|
* @var boolean
|
|
*/
|
|
protected $fold_menu = true;
|
|
|
|
/**
|
|
* Returns the title of the page.
|
|
*
|
|
* @since 2.0.0
|
|
* @return string Title of the page.
|
|
*/
|
|
public function get_title() {
|
|
|
|
return __('Checkout', 'wp-multisite-waas');
|
|
}
|
|
|
|
/**
|
|
* Returns the title of menu for this page.
|
|
*
|
|
* @since 2.0.0
|
|
* @return string Menu label of the page.
|
|
*/
|
|
public function get_menu_title() {
|
|
|
|
return __('Checkout', 'wp-multisite-waas');
|
|
}
|
|
|
|
/**
|
|
* Registers the necessary scripts.
|
|
*
|
|
* @since 2.0.0
|
|
* @return void
|
|
*/
|
|
public function register_scripts(): void {
|
|
|
|
do_action('wu_checkout_scripts', null, null);
|
|
}
|
|
|
|
/**
|
|
* Overrides the page loaded method.
|
|
*
|
|
* @since 2.0.0
|
|
* @return void
|
|
*/
|
|
public function page_loaded(): void {
|
|
|
|
do_action('wu_setup_checkout', null);
|
|
|
|
parent::page_loaded();
|
|
}
|
|
|
|
/**
|
|
* Returns the sections for this Wizard.
|
|
*
|
|
* @since 2.0.0
|
|
* @return array
|
|
*/
|
|
public function get_sections() {
|
|
|
|
$sections = [
|
|
'plan' => [
|
|
'title' => __('Change Membership', 'wp-multisite-waas'),
|
|
'view' => [$this, 'display_checkout_form'],
|
|
],
|
|
];
|
|
|
|
return $sections;
|
|
}
|
|
|
|
/**
|
|
* Displays the content of the activation section.
|
|
*
|
|
* @since 2.0.0
|
|
* @return void
|
|
*/
|
|
public function output(): void {
|
|
/*
|
|
* Renders the base edit page layout, with the columns and everything else =)
|
|
*/
|
|
wu_get_template(
|
|
'base/centered',
|
|
[
|
|
'screen' => get_current_screen(),
|
|
'page' => $this,
|
|
'content' => do_shortcode('[wu_checkout slug="wu-checkout"]'),
|
|
]
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Allow child classes to register widgets, if they need them.
|
|
*
|
|
* @since 1.8.2
|
|
* @return void
|
|
*/
|
|
public function register_widgets(): void {
|
|
|
|
\WP_Ultimo\UI\Current_Membership_Element::get_instance()->as_metabox(get_current_screen()->id);
|
|
|
|
\WP_Ultimo\UI\Simple_Text_Element::get_instance()->as_inline_content(get_current_screen()->id, 'wu_centered_right');
|
|
}
|
|
}
|