Skip to content

Instantly share code, notes, and snippets.

@slaFFik
Created September 25, 2017 13:38
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
WPForms: Hide forms on mobile
<?php
add_filter( 'wpforms_frontend_load', function( $load, $form_data, $var ) {
// Comment these lines if you need to hide a certain form only.
if ( wp_is_mobile() ) {
return false;
}
// Or check certain form only. Uncomment.
/*
if ( 123 == $form_data['id'] ) {
return false;
}
*/
return $load;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment