src/core/class-papi-core-property.php
public function register( $type = 'post' ) {
		if ( version_compare( get_bloginfo( 'version' ), '4.6', '<' ) ) {
			return false;
		}

		$type = papi_get_meta_type( $type );

		// Register option fields with the new `register_setting` function and only for WordPress 4.7.
		if ( $type === 'option' && version_compare( get_bloginfo( 'version' ), '4.7', '>=' ) ) {
			// The `type` will be the same for each fields, this is just to get it out
			// to the REST API, the output will be different for different fields and are
			// handled later on.
			return register_setting( 'papi', $this->get_slug( true ), [
				'sanitize_callback' => [$this, 'register_meta_sanitize_callback'],
				'show_in_rest'      => $this->get_option( 'show_in_rest' ),
				'type'              => 'string'
			] );
		}

		// Register meta fields with the new `register_meta` function.
		// The `type` will be the same for each fields, this is just to get it out
		// to the REST API, the output will be different for different fields and are
		// handled later on.
		return register_meta( $type, $this->get_slug( true ), [
			'auth_callback'     => $this->get_option( 'auth_callback' ),
			'description'       => $this->get_option( 'description' ),
			'sanitize_callback' => [$this, 'register_meta_sanitize_callback'],
			'show_in_rest'      => $this->get_option( 'show_in_rest' ),
			'single'            => $this->get_convert_type() !== 'array',
			'type'              => 'string'
		] );
	}
public function register( $type = 'post' ) {
		if ( version_compare( get_bloginfo( 'version' ), '4.6', '<' ) ) {
			return false;
		}

		$type = papi_get_meta_type( $type );

		// Register option fields with the new `register_setting` function and only for WordPress 4.7.
		if ( $type === 'option' && version_compare( get_bloginfo( 'version' ), '4.7', '>=' ) ) {
			// The `type` will be the same for each fields, this is just to get it out
			// to the REST API, the output will be different for different fields and are
			// handled later on.
			return register_setting( 'papi', $this->get_slug( true ), [
				'sanitize_callback' => [$this, 'register_meta_sanitize_callback'],
				'show_in_rest'      => $this->get_option( 'show_in_rest' ),
				'type'              => 'string'
			] );
		}

		// Register meta fields with the new `register_meta` function.
		// The `type` will be the same for each fields, this is just to get it out
		// to the REST API, the output will be different for different fields and are
		// handled later on.
		return register_meta( $type, $this->get_slug( true ), [
			'auth_callback'     => $this->get_option( 'auth_callback' ),
			'description'       => $this->get_option( 'description' ),
			'sanitize_callback' => [$this, 'register_meta_sanitize_callback'],
			'show_in_rest'      => $this->get_option( 'show_in_rest' ),
			'single'            => $this->get_convert_type() !== 'array',
			'type'              => 'string'
		] );
	}
Register property with:

- `register_meta` (WP 4.6+)

@param  string $type

@return bool