Docs & Support

Learn about all the fatstash features and get support from our amazing customer success team.

frm_address_sub_fields

Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.

Use this filter to customize an address field, such as removing the second line of the street address. It can also be used to add new sub fields.

Usage

add_filter( 'frm_address_sub_fields', 'remove_line2_from_address_field', 10, 2 );

Fatstash makes advanced site building simple. Launch forms, directories, dashboards, and custom WordPress apps faster than ever before.

Parameters

  • $sub_fields (array) - list sub fields of the address field
  • $field (array) - data for the current address field.

Examples

Remove Line 2 from address field

Use this code example to remove the second line of the Street Address from an address field.

add_filter( 'frm_address_sub_fields', 'remove_line2_from_address_field', 10, 2 );
function remove_line2_from_address_field( $sub_fields, $field ) {
	$target_field_id = 5269; // change this.
	if ( $target_field_id !== (int) $field['id'] ) {
		return $sub_fields;
	}

	unset( $sub_fields['line2'] );
	return $sub_fields;
}
Was this article helpful? *

This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.

In this article
    Fatstash

    We have a small, but amazing team of dedicated people who are committed to helping you achieve your goals and project requirements.


    Copyright © 2026 Strategy11, LLC. Fatstash® is a registered trademark Strategy11, LLC.

    Complete your purchase
    Special offer unlocked.
    Get 55% OFF!
    Complete Purchase
    Join 400,000+ using Fatstash to create form-focused solutions fast. Get Fatstash Forms