bookmark_bordergform_admin_error_messages

Description

Modify error messages displayed by Gravity Forms in the WordPress admin.

Usage

add_action( 'gform_admin_error_messages', 'my_custom_function' );

Parameters

  • $error_messages array

    An array of error messages to be displayed below the title on Gravity Form pages.

Examples

This example demonstrates how we can remove an error message.

add_action( 'gform_admin_error_messages', 'my_remove_error_message' );
function my_remove_error_message( $errors ) {

    // loop through our error messages
    for ( $i = count( $errors ); $i > 0; $i-- ) {

        // check if this is the error message we want to remove
        if ( $errors[$i] == __( 'Please select the fields to be exported', 'gravityforms' ) ) {
            unset( $errors[$i] );
        }

    }

    return $errors;
}

Source Code

This filter is located in GFCommon::display_admin_message() in common.php