1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Hide the postal code field.
|
6
|
*/
|
7
|
|
8
|
$plugin = array(
|
9
|
'title' => t('Hide the postal code'),
|
10
|
'format callback' => 'addressfield_format_address_hide_postal_code',
|
11
|
'type' => 'address',
|
12
|
'weight' => -85,
|
13
|
);
|
14
|
|
15
|
/**
|
16
|
* Format callback.
|
17
|
*
|
18
|
* @see CALLBACK_addressfield_format_callback()
|
19
|
*/
|
20
|
function addressfield_format_address_hide_postal_code(&$format, $address, $context = array()) {
|
21
|
if (isset($format['locality_block']['postal_code'])) {
|
22
|
$format['locality_block']['postal_code']['#access'] = FALSE;
|
23
|
}
|
24
|
}
|