Inline Datepicker only on Mobile Devices.

Instructions

Code

Filename: gpld-inline-datepicker-only-for-mobile-devices.php

<?php
/**
 * Gravity Perks // GP Limit Dates // Inline Datepicker only on Mobile Devices.
 * https://gravitywiz.com/documentation/gp-limit-dates/
 *
 * Instruction Video: https://www.loom.com/share/2e3e9838f2994b619402d18ff9f96114
 */
// Replace 278 with your Form ID, and 3 with your Date Field ID
add_filter( 'gpld_limit_dates_options_278_3', function( $options, $form, $field ) {
	if ( ! wp_is_mobile() ) {
		$options['inlineDatepicker'] = false;
	}
	return $options;
}, 10, 3);

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.