第二个参数是字段,该字段包含它所属的表单ID及其自己的ID,因此可以将特定表单/字段作为目标,如下所示:
add_filter( \'gform_other_choice_value\', function( $placeholder, $field ) {
// Update "123" to your form ID and "4" to your field ID.
if ( $field->formId == 123 && $field->id == 4 ) {
$placeholder = \'Your custom placeholder\';
}
return $placeholder;
}, 10, 2 );