Skip to content
WPCode Library

WPCode Library

Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!

Get WPCode
See all Features

  • Features
    • Code Snippets Library
    • Smart Conditional Logic
    • Advanced Code Revisions
    • Private Cloud Library
    • Marketing Scripts & Conversion Pixels
  • Pricing
  • Snippets Library
  • Help Center
    • Docs
    • Support
  • Blog
  • Login
  • Get WPCode

Snippets library

Browse Snippets
Claim your Free Profile
Add Snippet

Tag: metadata

WP Simple Pay: Copy Payment Metadata to Customer Metadata

/** * @link https://library.wpcode.com/snippet/e5wng05d/ * * @param StripeEvent $event Stripe Event. * @param StripeSubscription|StripePaymentIntent $object Stripe Subscription or PaymentIntent */ function simpay_add_metadata_to_customer( $event, $object ) { $customer_id = $object->customer->id; $customer = SimplePayCorePaymentsStripe_API::request( ‘Customer’, ‘update’, $customer_id, array( ‘metadata’ => $object->metadata->toArray(), )…Continue reading

WP Simple Pay: Copy Payment Metadata to Customer Metadata

/** * @link https://library.wpcode.com/snippet/e5wng05d/ * * @param \Stripe\Event $event Stripe Event. * @param \Stripe\Subscription|\Stripe\PaymentIntent $object Stripe Subscription or PaymentIntent */ function simpay_add_metadata_to_customer( $event, $object ) { $customer_id = $object->customer->id; $customer = \SimplePay\Core\Payments\Stripe_API::request( ‘Customer’, ‘update’, $customer_id, array( ‘metadata’ => $object->metadata->toArray(), )…Continue reading

WP Simple Pay: Add Customer Phone to Customer Metadata

/** * @link https://library.wpcode.com/snippet/d2zk7n2x/ */ add_filter( ‘simpay_get_customer_args_from_payment_form_request’, /** * @param array $args * @return array */ function( $args ) { if ( isset( $args[‘phone’] ) ) { $args[‘metadata’][‘phone’] = $args[‘phone’]; } return $args; } );Continue reading

WP Simple Pay: Modify Customer Record Creation

/** * @link https://library.wpcode.com/snippet/3234y0or/ */ add_filter( ‘simpay_get_customer_args_from_payment_form_request’, /** * @param array $customer_args * @param SimplePay\Core\Abstracts\Form $form Form instance. * @param array $form_data Form data generated by the client. * @param array $form_values Values of named fields in the payment form.…Continue reading

WP Simple Pay: Add Custom Field Data to Customer Metadata

/** * @link https://library.wpcode.com/snippet/924r645g/ */ add_filter( ‘simpay_get_customer_args_from_payment_form_request’, /** * @param array $customer_args Arguments for Customer. * @param \SimplePay\Core\Abstracts\Form $form Form instance. * @param array $deprecated Empty array. * @param array $form_values Values of named fields in the payment form. *…Continue reading

Company

  • About
  • Careers
  • Testimonials
  • Blog
  • Affiliates
  • Contact
  • Twitter
  • Facebook

Powerful Code Features

  • Ready-made Snippets Library
  • Smart Conditional Logic
  • Advanced Auto-insert Locations
  • Global Header & Footer Scripts
  • Safe Error Handling
  • WordPress Code Generators

  • Ecommerce Conversion Pixels
  • Dynamic Content Elements
  • Reduce Number of Plugins
  • Save Snippets in Cloud
  • Easy Code Management
  • Advanced Code Revisions

Helpful Links

  • Support
  • Documentation
  • Plans & Pricing
  • WordPress Hosting
  • Start a Blog
  • Make a Website

Copyright © 2025 WPCode. WPCode® is a registered trademark of WPCode, LLC

Terms of Service
Privacy Policy
FTC Disclosure
Sitemap
WPCode Coupon

The WordPress® trademark is the intellectual property of the WordPress Foundation. Uses of the WordPress®, names in this website are for identification purposes only and do not imply an endorsement by WordPress Foundation. WPCode is not endorsed or owned by, or affiliated with, the WordPress Foundation.

Snippet Preview