Description
The wpforms_frontend_enqueue_css_layout_field_viewport_breakpoint
allows changing the breakpoints when using a multi-column layout on the Layout and Repeater field.
Parameters
- $viewport_breakpoint
- (int) Viewport width in pixels.
- $form_data
- (array) Processed form settings/data, prepared to be used later.
Source
wpforms/src/Pro/Forms/Fields/Traits/Layout/Frontend.php
More Information
This filter is applied to all forms and lets you set the breakpoint for the Layout and Repeater fields that use a multi-column layout.
The default breakpoint for the Layout and Repeater fields with a multi-column layout is 600 pixels. However, with this filter, you’ll be able to customize the breakpoint to suit your specific needs.
Example
In the example below, the filter will apply a breakpoint value of 768 to all forms on your site that use a multi-column layout in the Layout or Repeater field. This means that on screens lower than 768 pixels, multi-column layouts will adopt a single column. You can adjust the value in the code snippet below to any screen size you’d like to target.
/**
* Filter the breakpoint (as viewport width in pixels) for the layout and repeater fields.
*
* @link https://wpforms.com/developers/wpforms_frontend_enqueue_css_layout_field_viewport_breakpoint/
*
* @param int $viewport_breakpoint The viewport width in pixels.
* @param array $form_data Form data.
*
*/
add_filter( 'wpforms_frontend_enqueue_css_layout_field_viewport_breakpoint', static function() {
return 768;
} );