LLMS_Meta_Box_Membership::save( int $post_id )
Save field data
Description Description
See also See also
Parameters Parameters
- $post_id
-
(int) (Required) WP_Post ID of the post being saved.
Return Return
(void)
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 ] ); } } }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.30.0 | Autoenroll courses saved via AJAX and removed from this method. |
3.0.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: