classes/PodsRESTFields.php
public static function field_allowed_to_extend( $field_name, $pod, $mode = 'read' ) {

		$allowed = false;

		if ( is_object( $pod ) ) {
			$field = $pod->fields( $field_name );

			if ( $field ) {
				$pod_options = $pod->pod_data['options'];

				$read_all  = (int) pods_v( 'read_all', $pod_options, 0 );
				$write_all = (int) pods_v( 'write_all', $pod_options, 0 );

				if ( 'read' === $mode && 1 === $read_all ) {
					$allowed = true;
				} elseif ( 'write' === $mode && 1 === $write_all ) {
					$allowed = true;
				} else {
					$rest_read  = (int) $pod->fields( $field_name, 'rest_read' );
					$rest_write = (int) $pod->fields( $field_name, 'rest_write' );

					if ( 'read' === $mode && 1 === $rest_read ) {
						$allowed = true;
					} elseif ( 'write' === $mode && 1 === $rest_write ) {
						$allowed = true;
					}
				}
			}//end if
		}//end if

		return $allowed;

	}
public static function field_allowed_to_extend( $field_name, $pod, $mode = 'read' ) {

		$allowed = false;

		if ( is_object( $pod ) ) {
			$field = $pod->fields( $field_name );

			if ( $field ) {
				$pod_options = $pod->pod_data['options'];

				$read_all  = (int) pods_v( 'read_all', $pod_options, 0 );
				$write_all = (int) pods_v( 'write_all', $pod_options, 0 );

				if ( 'read' === $mode && 1 === $read_all ) {
					$allowed = true;
				} elseif ( 'write' === $mode && 1 === $write_all ) {
					$allowed = true;
				} else {
					$rest_read  = (int) $pod->fields( $field_name, 'rest_read' );
					$rest_write = (int) $pod->fields( $field_name, 'rest_write' );

					if ( 'read' === $mode && 1 === $rest_read ) {
						$allowed = true;
					} elseif ( 'write' === $mode && 1 === $rest_write ) {
						$allowed = true;
					}
				}
			}//end if
		}//end if

		return $allowed;

	}
public static function field_allowed_to_extend ( $ field_name , $ pod , $ mode = 'read' ) { $ allowed = false ; if ( is_object ( $ pod ) ) { $ field = $ pod -> fields ( $ field_name ) ; if ( $ field ) { $ pod_options = $ pod -> pod_data [ 'options' ] ; $ read_all = ( int ) pods_v ( 'read_all' , $ pod_options , 0 ) ; $ write_all = ( int ) pods_v ( 'write_all' , $ pod_options , 0 ) ; if ( 'read' === $ mode && 1 === $ read_all ) { $ allowed = true ; } elseif ( 'write' === $ mode && 1 === $ write_all ) { $ allowed = true ; } else { $ rest_read = ( int ) $ pod -> fields ( $ field_name , 'rest_read' ) ; $ rest_write = ( int ) $ pod -> fields ( $ field_name , 'rest_write' ) ; if ( 'read' === $ mode && 1 === $ rest_read ) { $ allowed = true ; } elseif ( 'write' === $ mode && 1 === $ rest_write ) { $ allowed = true ; } } } //end if } //end if return $ allowed ; }
Check if a field supports read or write via the REST API.

@since 2.5.6

@param string $field_name The field name.
@param Pods   $pod        Pods object.
@param string $mode       Are we checking read or write?

@return bool If supports, true, else false.
Check if a field supports read or write via the REST API .