Detect mobile devices in WP 3.4

So there’s a new function in town for detecting mobile browsers — no need to rely on the syntactically incorrect $is_iphone!

Azaozz added in the new wp_is_mobile(); — no parameters, and it returns a Boolean — true or false.  Its a great way to future-proof your code, and outsource the browser detection to core, rather than having to maintain it as new browsers and devices get released.

Enjoy!

Author: George Stephanis

Cooking, Code, Carpentry, Letterpress.