Description
Use this filter to specify styles to be enqueued on Gravity Forms preview pages.
Usage
add_filter( 'gform_preview_styles', 'your_function_name', 10, 2 );
Parameters
- $styles array
Array of style handles to be enqueued.
-
$form Form Object
Current form.
Examples
This example enqueues a custom style on the preview page:
add_filter( 'gform_preview_styles', 'enqueue_custom_style', 10, 2) ; function enqueue_custom_style( $styles, $form ) { wp_register_style( 'my_style', get_stylesheet_directory_uri() . '/my_style.css' ); $styles = array( 'my_style' ); return $styles; }
Source Code
This filter is located in preview.php.