I have developed responsive theme and I want to submit it the wordpress.org. Before submitting it I want to use wp_is_mobile()
in my theme, but according to Function Reference/wp is mobile it is a bad idea because it say’s this :
You should realize that this does not detect a mobile phone specifically, as a tablet is considered a mobile device. Check the Plugins area for several helpful alternatives. It also should not be used for themes.
So if I use it in my theme functions.php like this:
add_filter('body_class','mobile_theme_body_class');
function mobile_theme_body_class( $classes ){
if ( wp_is_mobile() ){
$classes[] = 'mobile';
}
else{
$classes[] = 'desktop';
}
return $classes;
}
Will my theme be rejected ?
Sub-question:
If I use my function like in the code above and use Caching Plugins like (WP Super Cache) is my function gonna be messed up (failed to execute or returning false positives) ?
Thank you for your time and answers…