Automattic\WooCommerce\Internal\StockNotifications\Admin

NotificationEditPage::outputpublicWC 1.0

Render page.

Method of the class: NotificationEditPage{}

No Hooks.

Returns

null. Nothing (null).

Usage

$NotificationEditPage = new NotificationEditPage();
$NotificationEditPage->output();

NotificationEditPage::output() code WC 10.3.6

public function output() {
	$table           = new ListTable();
	$notification_id = isset( $_GET['notification_id'] ) ? absint( wp_unslash( $_GET['notification_id'] ) ) : 0; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
	if ( $notification_id ) {
		$notification = Factory::get_notification( $notification_id );
	}

	if ( ! $notification instanceof Notification ) {
		$notice_message = __( 'Notification not found.', 'woocommerce' );
		NotificationsPage::add_notice( $notice_message, 'error' );
		wp_safe_redirect( admin_url( NotificationsPage::PAGE_URL ) );
		exit;
	}

	$this->process_edit_form( $notification );
	$table->process_delete_action();

	$signed_up_customers = $table->data_store->query(
		array(
			'product_id' => $notification->get_product_id(),
			'return'     => 'count',
		)
	);

	include __DIR__ . '/Templates/html-admin-notification-edit.php';
}