Apple just released iOS 11.4.1 with an improved Find My AirPod feature and some stability fixes. It also appears to include USB Restricted Mode, a feature that was part of the 11.4.1 and iOS 12 betas. Though it wasn't in the release notes that popped up on your iOS device, we have confirmed that the mode is included.
Restricted mode was created to protect iPhones against USB devices used by law enforcement to crack your passcode and get around encryption. It disables USB access after the phone has been locked for an hour, instead of a week as was previously the rule. To see the new mode toggle, drop into your Settings app and look under Touch ID (or Face ID if you have an iPhone X). There will be a new toggle button for USB Accessories there. Access is already disabled by default, so toggling it on with a tap will allow access for USB accessories.
Update 7/9/18 4:45PM: This post has been edited to more accurately reflect how the toggle switch works.