protected function validate_by_callbacks( array $data, array $callbacks ) {
		foreach ( $callbacks as $key => $callback ) {
			$validity = new WP_Error;

			$value = array_key_exists( $key, $data ) ? $data[ $key ] : null;
			$callback( $validity, $value );

			if ( is_wp_error( $validity ) && count( $validity->errors ) > 0 ) {
				$this->add_error( $key, $validity->get_error_messages() );
			}
		}
	}
protected function validate_by_callbacks( array $data, array $callbacks ) {
		foreach ( $callbacks as $key => $callback ) {
			$validity = new WP_Error;

			$value = array_key_exists( $key, $data ) ? $data[ $key ] : null;
			$callback( $validity, $value );

			if ( is_wp_error( $validity ) && count( $validity->errors ) > 0 ) {
				$this->add_error( $key, $validity->get_error_messages() );
			}
		}
	}
protected function validate_by_callbacks ( array $ data , array $ callbacks ) { foreach ( $ callbacks as $ key => $ callback ) { $ validity = new WP_Error ; $ value = array_key_exists ( $ key , $ data ) ? $ data [ $ key ] : null ; $ callback ( $ validity , $ value ) ; if ( is_wp_error ( $ validity ) && count ( $ validity -> errors ) > 0 ) { $ this -> add_error ( $ key , $ validity -> get_error_messages ( ) ) ; } } }
Validate fields use "validate_cb" parameter.

@param array $data
@param array $callbacks
Validate fields use validate_cb parameter .