gplp_preview_template

  1. Description
  2. Usage
  3. Parameters
  4. Examples
    1. Set Custom Preview Template Path
  5. Since

Description

Filter the template used to render the Live Preview.

Usage

add_filter( 'gplp_preview_template', $template );

Parameters

  • template string

    The absolute path to the desired template file. For example, /app/public/wp-content/themes/twentytwenty/page.php.

Examples

Set Custom Preview Template Path

<?php
/**
 * Gravity Perks // Live Preview // Set Custom Preview Template Path
 * https://gravitywiz.com/documentation/gravity-forms-live-preview/
 *
 * Set the path to a custom template with which your forms should be displayed when using Live Preview.
 */
add_filter( 'gplp_preview_template', function( $template ) {
	return get_stylesheet_directory() . '/custom-template.php';
} );

Since

This filter is available since GP Live Preview 1.2.4.