Does unopened whole wheat flour have to be refrigerated?
Whole wheat flour will turn rancid faster than AP flour because the germ contains oil. For best baking results you should use the flour within one month (opened and unopened) (source: 1 and 2). You can use the flour even longer but it will taste rancid and the gluten won't work as well as in new flour (source: 3). As far as I know there are no health concerns if older flour is used.

Flour can be refrigerated and be freezed. This will slow down the oxidization. If you want to use the previously chilled flour, make sure that the flour is warm then for good baking results. (source: 1).


Sources
1: Does white whole wheat flour need to be refrigerated?
2: How long can I store a food in the pantry, refrigerator, or freezer?
3. How to store flour