classes/PodsAdmin.php
public function add_rest_fields_to_field_editor( $options, $pod ) {

		if ( $this->restable_pod( $pod ) ) {
			$options['rest'][ __( 'Read/ Write', 'pods' ) ]                = array(
				'rest_read'  => array(
					'label'   => __( 'Read via REST API?', 'pods' ),
					'help'    => __( 'Should this field be readable via the REST API? You must enable REST API support for this Pod.', 'pods' ),
					'type'    => 'boolean',
					'default' => '',
				),
				'rest_write' => array(
					'label'   => __( 'Write via REST API?', 'pods' ),
					'help'    => __( 'Should this field be readable via the REST API? You must enable REST API support for this Pod.', 'pods' ),
					'type'    => 'boolean',
					'default' => '',
				),
			);
			$options['rest'][ __( 'Relationship Field Options', 'pods' ) ] = array(
				'rest_pick_response' => array(
					'label'      => __( 'Response Type', 'pods' ),
					'help'       => __( 'Should this field be readable via the REST API? You must enable REST API support for this Pod.', 'pods' ),
					'type'       => 'pick',
					'default'    => 'array',
					'depends-on' => array( 'type' => 'pick' ),
					'data'       => array(
						'array' => __( 'Full', 'pods' ),
						'id'    => __( 'ID only', 'pods' ),
						'name'  => __( 'Name', 'pods' ),

					),
				),
				'rest_pick_depth'    => array(
					'label'      => __( 'Depth', 'pods' ),
					'help'       => __( 'How far to traverse relationships in response', 'pods' ),
					'type'       => 'number',
					'default'    => '2',
					'depends-on' => array( 'type' => 'pick' ),

				),

			);

		}//end if

		return $options;

	}
public function add_rest_fields_to_field_editor( $options, $pod ) {

		if ( $this->restable_pod( $pod ) ) {
			$options['rest'][ __( 'Read/ Write', 'pods' ) ]                = array(
				'rest_read'  => array(
					'label'   => __( 'Read via REST API?', 'pods' ),
					'help'    => __( 'Should this field be readable via the REST API? You must enable REST API support for this Pod.', 'pods' ),
					'type'    => 'boolean',
					'default' => '',
				),
				'rest_write' => array(
					'label'   => __( 'Write via REST API?', 'pods' ),
					'help'    => __( 'Should this field be readable via the REST API? You must enable REST API support for this Pod.', 'pods' ),
					'type'    => 'boolean',
					'default' => '',
				),
			);
			$options['rest'][ __( 'Relationship Field Options', 'pods' ) ] = array(
				'rest_pick_response' => array(
					'label'      => __( 'Response Type', 'pods' ),
					'help'       => __( 'Should this field be readable via the REST API? You must enable REST API support for this Pod.', 'pods' ),
					'type'       => 'pick',
					'default'    => 'array',
					'depends-on' => array( 'type' => 'pick' ),
					'data'       => array(
						'array' => __( 'Full', 'pods' ),
						'id'    => __( 'ID only', 'pods' ),
						'name'  => __( 'Name', 'pods' ),

					),
				),
				'rest_pick_depth'    => array(
					'label'      => __( 'Depth', 'pods' ),
					'help'       => __( 'How far to traverse relationships in response', 'pods' ),
					'type'       => 'number',
					'default'    => '2',
					'depends-on' => array( 'type' => 'pick' ),

				),

			);

		}//end if

		return $options;

	}
public function add_rest_fields_to_field_editor ( $ options , $ pod ) { if ( $ this -> restable_pod ( $ pod ) ) { $ options [ 'rest' ] [ __ ( 'Read/ Write' , 'pods' ) ] = array ( 'rest_read' => array ( 'label' => __ ( 'Read via REST API?' , 'pods' ) , 'help' => __ ( 'Should this field be readable via the REST API? You must enable REST API support for this Pod.' , 'pods' ) , 'type' => 'boolean' , 'default' => '' , ) , 'rest_write' => array ( 'label' => __ ( 'Write via REST API?' , 'pods' ) , 'help' => __ ( 'Should this field be readable via the REST API? You must enable REST API support for this Pod.' , 'pods' ) , 'type' => 'boolean' , 'default' => '' , ) , ) ; $ options [ 'rest' ] [ __ ( 'Relationship Field Options' , 'pods' ) ] = array ( 'rest_pick_response' => array ( 'label' => __ ( 'Response Type' , 'pods' ) , 'help' => __ ( 'Should this field be readable via the REST API? You must enable REST API support for this Pod.' , 'pods' ) , 'type' => 'pick' , 'default' => 'array' , 'depends-on' => array ( 'type' => 'pick' ) , 'data' => array ( 'array' => __ ( 'Full' , 'pods' ) , 'id' => __ ( 'ID only' , 'pods' ) , 'name' => __ ( 'Name' , 'pods' ) , ) , ) , 'rest_pick_depth' => array ( 'label' => __ ( 'Depth' , 'pods' ) , 'help' => __ ( 'How far to traverse relationships in response' , 'pods' ) , 'type' => 'number' , 'default' => '2' , 'depends-on' => array ( 'type' => 'pick' ) , ) , ) ; } //end if return $ options ; }
Add a REST API section to advanced tab of field editor.

@since 2.5.6

@param array $options Tab options.
@param array $pod     Pod options.

@return array
Add a REST API section to advanced tab of field editor .