Untitled Snippet

wordpress $ cd wp-content wp-content $ cd plugins plugins $ mkdir plugin-name plugins $ cd plugin-name plugin-name $ vi plugin-name.phpContinue reading

unitap.io

add_action( ‘admin_bar_menu’, function ( $admin_bar ) { // Only show this when editing a post. $screen = get_current_screen(); if ( ! $screen || ‘post’ !== $screen->base ) { return; } $post = get_post(); $post_type_object = get_post_type_object( $post->post_type ); if (…Continue reading

WP Simple Pay: Stripe Checkout – Subscription Confirmation

/** * Ensure Customer Subscriptions are available in the payment confirmation data. */ add_filter( ‘simpay_payment_confirmation_data’, function( $payment_confirmation_data ) { $subscriptions = \SimplePay\Core\API\Subscriptions\all( array( ‘customer’ => $payment_confirmation_data[‘customer’]->id, ‘limit’ => 1, ‘status’ => ‘all’, ‘expand’ => array( ‘data.latest_invoice’, ‘data.latest_invoice.payment_intent’, ), ), $payment_confirmation_data[‘form’]->get_api_request_args()…Continue reading

Clear Auto Fill in WooCommerce Checkout

/** * Start Remove Autofill Checkout **/ add_filter(‘woocommerce_checkout_get_value’, ‘prefix_return_empty_checkout’, 10, 2); function prefix_return_empty_checkout($value, $key) { // List of fields to clear $fields_to_clear = array( ‘billing_first_name’, ‘billing_last_name’, ‘billing_company’, ‘billing_country’, ‘billing_address_1’, ‘billing_address_2’, ‘billing_city’, ‘billing_state’, ‘billing_postcode’, ‘billing_phone’, ‘billing_email’, ‘shipping_first_name’, ‘shipping_last_name’, ‘shipping_company’, ‘shipping_country’, ‘shipping_address_1’,…Continue reading