public/wordpress/wp-content/plugins/wp-courseware/includes/models/unit.php
/**
	 * Save Unit
	 *
	 * @since 4.4.0
	 *
	 * @param bool $save_post Should the course post be saved? Default is true.
	 * @param bool $run_hook Should we run the course details updated hook. Used for updating course progress.
	 *
	 * @return bool True if successfull, False on failure
	 */


@param bool $save_post Should the course post be saved. Default is true.
@param bool $run_hook Should we run the course details updated hook. Used for updating course progress.

@return bool True if successfull, False on failure
@param bool $save_post Should the course post be saved . Default is true . @param bool $run_hook Should we run the course details updated hook . Used for updating course progress . @return bool True if successfull False on failure
public function save( $save_post = true ) {
		$data = $this->get_data( true );
		if ( empty( $data ) || ! is_array( $data ) ) {
			return false;
		}
		$data = wp_unslash( $data );
		$this->db->update( $this->get_id(), $data );
		if ( $save_post ) {
			if ( isset( $this->post_data['post_modified'], $this->post_data['post_modified_gmt'] ) ) {
				unset( $this->post_data['post_modified'], $this->post_data['post_modified_gmt'] );
			}
			wp_update_post( $this->get_post_data() );
		}
		return $this->get_id();
	}
public function save ( $ save_post = true ) { $ data = $ this -> get_data ( true ) ; if ( empty ( $ data ) || ! is_array ( $ data ) ) { return false ; } $ data = wp_unslash ( $ data ) ; $ this -> db -> update ( $ this -> get_id ( ) , $ data ) ; if ( $ save_post ) { if ( isset ( $ this -> post_data [ 'post_modified' ] , $ this -> post_data [ 'post_modified_gmt' ] ) ) { unset ( $ this -> post_data [ 'post_modified' ] , $ this -> post_data [ 'post_modified_gmt' ] ) ; } wp_update_post ( $ this -> get_post_data ( ) ) ; } return $ this -> get_id ( ) ; }
Save Unit
 @since 4.4.0
Save Unit @since 4 . 4 . 0
// Update Post.