gppa_object_merge_tag_replacement_value

  1. Description
  2. Usage
  3. Parameters
  4. Examples
    1. Convert arrays to a comma separated list
  5. Since

Description

Modify the results of merge tag value before it’s returned to the calling function.

Usage

add_filter( 'gppa_object_merge_tag_replacement_value', 'my_custom_function', 10, 3 );

Parameters

  • replace mixed

    Values to replace merge tag in the operation.

  • object Object

    Current object returning results (e.g. WP_Post).

  • $match array

    Merge tag matching parts.

Examples

Convert arrays to a comma separated list

<?php
/**
 * Gravity Perks // Populate Anything // Convert Arrays To A Comma Separated List
 * https://gravitywiz.com/documentation/gravity-forms-populate-anything/
 */
add_filter( 'gppa_object_merge_tag_replacement_value', function( $replace, $object, $match ) {
	return is_array( $replace ) ? join( ', ', $replace ) : $replace;
}, 10, 3 );

Since

This filter is available since Gravity Forms Populate Anything 1.0-beta-2.12