WP Simple Pay: Add Customer Shipping Address to Payment Metadata

/** * @link https://library.wpcode.com/snippet/m5ljwkl2/ */ add_filter( ‘simpay_get_paymentintent_args_from_payment_form_request’, function( $args, $form ) { $customer = \SimplePay\Core\API\Customers\retrieve( $args[‘customer’], $form->get_api_request_args() ); $shipping_address = $customer->shipping->address; $shipping_name = $customer->shipping->name; $shipping_phone = $customer->shipping->phone; $args[‘metadata’][‘Shipping-name’] = $shipping_name; $args[‘metadata’][‘Shipping-phone’] = $shipping_phone; foreach ( $shipping_address->toArray() as $key => $value…Continue reading

[Admin] – Manage clinic locations

// Register menus add_action(‘admin_menu’, ‘register_vtc_form_menus’); function register_vtc_form_menus() { add_menu_page(‘VTC Form’, ‘VTC Form’, ‘manage_options’, ‘vtc_form’, ‘display_vtc_form_admin_page’, ‘dashicons-forms’, 6); add_submenu_page(‘vtc_form’, ‘Manage Clinics’, ‘Manage Clinics’, ‘manage_options’, ‘vtc_form_clinics’, ‘display_vtc_form_clinics_page’); } // Display the main admin page content function display_vtc_form_admin_page() { if (!current_user_can(‘manage_options’)) return; echo…Continue reading

nTask

Verify Email – nTask nTask Project Management Simplified You’ve got mail! You’ve been successfully registered if you weren’t before please check your email to complete the signup. Check your spam / junk folder if you don’t see the email in…Continue reading

redirect_non_access_users_to_donation_page

function redirect_non_access_users_to_donation_page() { // Check if we are on a singular page and it’s not the admin area if (!is_admin() && is_singular()) { global $post; // Check if the current user has access to the post if (function_exists(‘pmpro_has_membership_access’)) { $has_access…Continue reading