Field::value( mixed $custom_val = null )

Description #

Get value of a field.

Parameters #

  • $custom_val
    mixed (Optional) Set custom value for field. Default value: null

Changelog #

VersionDescription
4.1.8Introduced.

Source #

File: lib/form/class-field.php

	public function value( $custom_val = null ) {
		if ( null !== $custom_val ) {
			$this->value = $custom_val;
			return true;
		}

		if ( ! is_null( $this->value ) ) {
			return $this->value;
		}

		$sanitized = $this->sanitize();
		if ( null !== $sanitized ) {
			return $sanitized;
		}

		return $this->get( 'value' );
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment