پرش به محتویات

"Filter: bricks/element/form/honeypot/result"

هنگامی‌که یک فیلد honeypot فعال می‌شود (تشخیص هرزنامه) نتیجه بازگشتی را فیلتر می‌کند. این به شما امکان می‌دهد پیام خطای نمایش داده شده را برای ربات های احتمالی (یا کاربرانی که به طور تصادفی فیلد پنهان را پر کرده اند) سفارشی کنید.

پارامترها

  • $result (array): The result array, typically containing ['type' => 'error', 'message' => '...'].
  • $field_id (string): The ID of the honeypot field that was filled.
  • $form (object): The Form integration object.

نمونه استفاده

add_filter( 'bricks/element/form/honeypot/result', function( $result, $field_id, $form ) {
    // Customize the error message
    $result['message'] = esc_html__( 'Spam detected. Please do not fill out the hidden fields.', 'my-domain' );

    return $result;
}, 10, 3 );