Home / Admin / Change “City” To Town/City
Duplicate Snippet

Embed Snippet on Your Site

Change “City” To Town/City

Change the label of the"City" field into a "Town/City" field.

Code Preview
php
<?php
/**
 * Change the  label of the "City" field into a "Town/City" field.
 *
 * @param   array[] $fields
 * @return  array[]
 */
add_action(
	'init',
	function ( $fields ) {
		$fields = charitable()->donation_fields();
		$field  = $fields->get_field( 'city' );
		$field->label = 'Town/City';
		$field->set( 'donation_form', 'label', 'Town/City' );
	},
	11
);

Comments

Add a Comment