Keep up to date with Gravity PDF

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

Description #description

Use this filter to change the order of array keys in the $form_data array.

Version #version

This filter was introduced in Gravity PDF 4.4.

Parameters #parameters

$order | array
The array of $form_data keys in the exact order they should get displayed

Usage #usage

This snippet will re-order the misc and field keys in the $form_data array.

add_filter( 'gfpdf_form_data_key_order', function( $order ) {
    /* Get the array key for the matching values */
    $search_key  = array_search( 'field', $order );
    $search_key2 = array_search( 'misc', $order );

    /* Remove the field array item from the $order */
    $fields      = array_splice( $order, $search_key, 1 );

    /* Insert the field array before the misc array item in the $order */
    array_splice( $order, $search_key2, 0, $fields );

    return $order;
} );

Source Code #source-code

This filter is located in the Model_PDF::get_form_data() method of /src/model/Model_PDF.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 (¥)