gform_admin_error_messages

gform_admin_error_messages

DescriptionUsageParametersExamplesSource Code

Description
Modify error messages displayed by Gravity Forms in the WordPress admin.
Usage
1add_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.
123456789101112131415add_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

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注