gp_qr_code_merge_tag_value

  1. Description
  2. Usage
  3. Parameters
  4. Since
  5. Examples
    1. Custom Modifiers

Description

Filters the QR Code merge tag value.

Usage

add_filter( 'gp_qr_code_merge_tag_value', 'my_custom_function' );

Parameters

  • value string

    The QR code merge tag value.

  • qr_url string

    The QR code URL.

  • merge_tag_value string

    The raw value of the merge tag that has been converted into a QR code.

  • modifiers array

    The merge tag modifiers.

  • form array|null

    The current form (if provided).

Since

This filter is available since Gravity Forms QR Code 1.0.10.

Examples

Custom Modifiers

Create a custom modifier. This example adds a “filename” modifier that returns the filename of the generated QR code. This code would be activated with a merge tag like so: {My Field:1:qr,filename}.

add_filter( 'gp_qr_code_merge_tag_value', function( $value, $qr_url, $merge_tag_value, $modifiers, $form ) {
    if ( isset( $modifiers['filename'] ) ) {
        $value = pathinfo( $qr_url, PATHINFO_BASENAME );
    }
    return $value;
}, 10, 5 );