LLMS_Meta_Box_Order_Details::save( int $post_id )

Save method Does nothing because there’s no editable data in this metabox


Description Description


Parameters Parameters

$post_id

(int) (Required) Post ID of the Order


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/admin/post-types/meta-boxes/class.llms.meta.box.order.details.php

	public function save( $post_id ) {

		$order = llms_get_post( $this->post );
		if ( ! $order || ! is_a( $order, 'LLMS_Order' ) ) {
			return;
		}
		// $gateway = $order->get_gateway();

		$fields = array(
			'payment_gateway',
			'gateway_customer_id',
			'gateway_subscription_id',
			'gateway_source_id',
		);

		foreach ( $fields as $key ) {

			if ( isset( $_POST[ $key ] ) ) {
				$order->set( $key, sanitize_text_field( $_POST[ $key ] ) );
			}
		}

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.





Permalink: