LLMS_Meta_Box_Membership::save( int $post_id )

Save field data


Description Description

See also See also


Top ↑

Parameters Parameters

$post_id

(int) (Required) WP_Post ID of the post being saved.


Top ↑

Return Return

(void)


Top ↑

Source Source

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

	public function save( $post_id ) {

		$membership = new LLMS_Membership( $post_id );

		if ( ! isset( $_POST[ $this->prefix . 'restriction_add_notice' ] ) ) {
			$_POST[ $this->prefix . 'restriction_add_notice' ] = 'no';
		}

		// save all the fields
		$fields = array(
			'restriction_redirect_type',
			'redirect_page_id',
			'redirect_custom_url',
			'restriction_add_notice',
			'restriction_notice',
			'sales_page_content_page_id',
			'sales_page_content_type',
			'sales_page_content_url',
		);
		foreach ( $fields as $field ) {

			if ( isset( $_POST[ $this->prefix . $field ] ) ) {

				$membership->set( $field, $_POST[ $this->prefix . $field ] );

			}
		}

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.30.0 Autoenroll courses saved via AJAX and removed from this method.
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: