public static function register() {
		foreach ( [ 'post', 'user' ] as $type ) {
			\register_rest_field(
				'post' === $type ? get_post_types() : $type ,
				self::FIELD_NAME,
				[ 'get_callback' => [ __CLASS__, 'get_' . $type . '_fields' ] ]
			);
		}
	}
public static function register() {
		foreach ( [ 'post', 'user' ] as $type ) {
			\register_rest_field(
				'post' === $type ? get_post_types() : $type ,
				self::FIELD_NAME,
				[ 'get_callback' => [ __CLASS__, 'get_' . $type . '_fields' ] ]
			);
		}
	}
public static function register ( ) { foreach ( [ 'post' , 'user' ] as $ type ) { \ register_rest_field ( 'post' === $ type ? get_post_types ( ) : $ type , self :: FIELD_NAME , [ 'get_callback' => [ __CLASS__ , 'get_' . $ type . '_fields' ] ] ) ; } }
Register the field for all post types and users.
Register the field for all post types and users .