Keep up to date with Gravity PDF

  • This field is for validation purposes and should be left unchanged.
Jump To Section

Description #description

This filter can be used to change the inner HTML mark-up that’s wrapped around Section Break fields. This mark-up is then sent to the PDF renderer.

Version #version

This filter was introduced in Gravity PDF 4.1.

Parameters #parameters

$html | string
The formatted HTML for the section field
$title | string
The Section Break title text
$description | string
The Section Break description text
$value | array
An associative array containing the ‘title’ and ‘description’ keys
$field | array
The Gravity Form field currently being processed
$form | array
The current Gravity Form array
$entry | array
The raw Gravity Form Entry array.
$class | object
The Gravity PDF Section Break field wrapper class

Usage #usage

This snippet simplifies the mark-up for the Section Break:

add_action( 'gfpdf_field_section_break_html', function( $html, $title, $description, $value, $field, $form, $entry, $class ) {

    $html = "
        <div class='field'>
            <em>{$title}: </em> $description
        </div>
    ";

    return $html;

}, 10, 8 );

If you wanted to restrict this to a particular Gravity Form you could use this snippet:

add_action( 'gfpdf_field_section_break_html', function( $html, $title, $description, $value, $field, $form, $entry, $class ) {

    if ( 10 == $form['id'] ) {
        $html = "
            <div class='field'>
                <em>{$title}: </em> $description
            </div>
        ";
    }

    return $html;

}, 10, 8 );

Source Code #source-code

This filter is located in the Field_Section::html() method of /src/helper/fields/Field_Section.php.

Signup for the latest Gravity PDF news, tips and updates

  • This field is for validation purposes and should be left unchanged.
Scroll To Top

Choose your currency:

Close
Converted prices are for reference only - all orders are charged in $ Australian Dollars ($) AUD.
  • AUDAustralian Dollars ($)
  • USDUS Dollars ($)
  • CADCanadian Dollars ($)
  • EUREuros (€)
  • GBPPound Sterling (£)
  • NZDNew Zealand Dollar ($)
  • JPYJapanese Yen (¥)