wordpress/wp-content/themes/basic/themify/themify-metabox/includes/themify-metabox-core.php
/**
	 * Helper function that saves the custom field
	 *
	 * @since 1.0.2
	 */
Helper function that saves the custom field
@since 1.0.2
Helper function that saves the custom field @since 1 . 0 . 2
function _save_meta( $field, $post_id ) {
		$new_meta = isset( $field['name'], $_POST[ $field['name'] ] ) ? $_POST[ $field['name'] ] : '';
		if ($new_meta === 'default'|| ( isset( $field['default'] ) && $new_meta == $field['default'] )) {
			$new_meta = '';
		}
		if ( '' === $new_meta ) {
			if ( metadata_exists( 'post', $post_id, $field['name'] ) ) {
				delete_post_meta( $post_id, $field['name'] );
			}
			return;
		}
		if (isset( $field['type'] ) && ($field['type'] === 'textbox' || $field['type'] === 'textarea' ) && ! current_user_can( 'unfiltered_html' )) {
			$new_meta = wp_kses_data( $new_meta );
		}
		$old_meta = get_post_meta( $post_id, $field['name'], true );
		if ( $new_meta !== '' && $new_meta != $old_meta ) {
			update_post_meta( $post_id, $field['name'], $new_meta );
		}
	}
function _save_meta ( $ field , $ post_id ) { $ new_meta = isset ( $ field [ 'name' ] , $ _POST [ $ field [ 'name' ] ] ) ? $ _POST [ $ field [ 'name' ] ] : '' ; if ( $ new_meta === 'default' || ( isset ( $ field [ 'default' ] ) && $ new_meta == $ field [ 'default' ] ) ) { $ new_meta = '' ; } if ( '' === $ new_meta ) { if ( metadata_exists ( 'post' , $ post_id , $ field [ 'name' ] ) ) { delete_post_meta ( $ post_id , $ field [ 'name' ] ) ; } return ; } if ( isset ( $ field [ 'type' ] ) && ( $ field [ 'type' ] === 'textbox' || $ field [ 'type' ] === 'textarea' ) && ! current_user_can ( 'unfiltered_html' ) ) { $ new_meta = wp_kses_data ( $ new_meta ) ; } $ old_meta = get_post_meta ( $ post_id , $ field [ 'name' ] , true ) ; if ( $ new_meta !== '' && $ new_meta != $ old_meta ) { update_post_meta ( $ post_id , $ field [ 'name' ] , $ new_meta ) ; } }
Helper function that saves the custom field
 @since 1.0.2
Helper function that saves the custom field @since 1 . 0 . 2
// when a default value is set for the field and it's the same as $new_meta, do not bother with saving the field // remove empty meta fields from database /* sanitization */