gform_notes_avatar

Description

The gform_notes_avatar filter can be used to filter the avatar used in entry notes.

Usage

Applies to all entries from all forms:

add_filter( 'gform_notes_avatar', 'your_function_name', 10, 2 );

Applies only to entries from a form with ID 123:

add_filter( 'gform_notes_avatar_123', 'your_function_name', 10, 2 );

Parameters

  • $avatar string
    URL of the avatar image to use
  • $note array
    The note object being processed

Examples

1. Replace the Avatar with a custom Avatar for Gravity Flow

function custom_gravityflow_notes_avatar( $avatar, $note ) {
    // Check if the note_type matches the specific type for the addon
    if ( $note->note_type === 'gravityflow' ) {
        // Provide your custom avatar URL
        $custom_avatar_url = 'https://example.com/path/to/custom/avatar.jpg'; // Replace with your custom avatar URL
        $avatar = '<img src="' . esc_url( $custom_avatar_url ) . '" alt="Gravity Flow Avatar" />';
    }

    return $avatar;
}

// Apply the filter
add_filter( 'gform_notes_avatar', 'custom_gravityflow_notes_avatar', 10, 2 );

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?

Since

This filter was added in Gravity Forms 2.7

Source Code

This filter is located in class GFEntryDetail in /entry_detail.php.