address-hide-administrative-area.inc 581 B

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