public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/builder/recordsform.php
/**
		 * Method called when form details are being saved.
		 *
		 * @param Array $formValues The list of settings being saved.
		 *
		 * @see wplib/RecordsForm::handleSave()
		 */
Method called when form details are being saved.
@param Array $formValues The list of settings being saved.


Method called when form details are being saved . @param Array $formValues The list of settings being saved .
protected function handleSave( $formValues ) {
			$metaSaveList = array();
			if ( ! empty( $this->meta_element_list ) ) {
				foreach ( $this->meta_element_list as $fieldName ) {
					$metaSaveList[ $fieldName ] = $this->formObj->getArrayValue( $formValues, $fieldName );
					unset( $formValues[ $fieldName ] );
				}
			}
			$recordID = $this->handleSaveMainDetails( $formValues );
			if ( $recordID && ! empty( $metaSaveList ) ) {
				if ( ! $this->metaTableName ) {
					$this->messages = $this->showMessage( 'handleSave(): Nothing could be saved, as the meta table name is not valid.', true );
					return false;
				}
				$this->saveMetaData( $metaSaveList, $recordID );
			}
		}
protected function handleSave ( $ formValues ) { $ metaSaveList = array ( ) ; if ( ! empty ( $ this -> meta_element_list ) ) { foreach ( $ this -> meta_element_list as $ fieldName ) { $ metaSaveList [ $ fieldName ] = $ this -> formObj -> getArrayValue ( $ formValues , $ fieldName ) ; unset ( $ formValues [ $ fieldName ] ) ; } } $ recordID = $ this -> handleSaveMainDetails ( $ formValues ) ; if ( $ recordID && ! empty ( $ metaSaveList ) ) { if ( ! $ this -> metaTableName ) { $ this -> messages = $ this -> showMessage ( 'handleSave(): Nothing could be saved, as the meta table name is not valid.' , true ) ; return false ; } $ this -> saveMetaData ( $ metaSaveList , $ recordID ) ; } }
Method called when form details are being saved.
Method called when form details are being saved .
// Remove all meta data from the details to be saved // Copy new value to our meta save list. // Remove the meta data from the list about to be saved to the normal form. // Save the normal details to the main table now that it's been cleaned of the metadata // Got meta data to save? If there's an error with above, we'll handle that there and quit anyway. // Check we have a table to save data to. // OK, have a meta table to save to, and normal record saved fine.