LLMS_Meta_Box_Course_Options::save_before( int $post_id )
Update course difficulty on save
Description Description
Parameters Parameters
- $post_id
-
(int) (Required) WP Post ID of the course
Return Return
(void)
Source Source
File: includes/admin/post-types/meta-boxes/class.llms.meta.box.course.options.php
protected function save_before( $post_id ) { if ( ! function_exists( 'register_block_type' ) || ! llms_blocks_is_post_migrated( $this->post->ID ) ) { if ( ! isset( $_POST['_llms_post_course_difficulty'] ) ) { $difficulty = ''; } else { $difficulty = $_POST['_llms_post_course_difficulty']; } wp_set_object_terms( $post_id, $difficulty, 'course_difficulty', false ); unset( $_POST['_llms_post_course_difficulty'] ); // don't save this to the postmeta table } }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: