Skip to content

Instantly share code, notes, and snippets.

@pablo-sg-pacheco
Last active October 5, 2016 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pablo-sg-pacheco/62c5c31ef484fddb7ff13de0d74c55d0 to your computer and use it in GitHub Desktop.
Save pablo-sg-pacheco/62c5c31ef484fddb7ff13de0d74c55d0 to your computer and use it in GitHub Desktop.
Add default contact details fields
<?php
//Add default contact details fields
add_filter('contact_details', function( $details ) {
unset($details['phone']);
unset($details['fax']);
unset($details['email']);
unset($details['mobile']);
unset($details['address']);
$details['country'] = array(
'label' => __('País'),
'input' => 'input'
);
$details['state'] = array(
'label' => __('Estado'),
'input' => 'input'
);
$details['city'] = array(
'label' => __('Cidade'),
'input' => 'input'
);
$details['neighborhood'] = array(
'label' => __('Bairro'),
'input' => 'input'
);
$details['address'] = array(
'label' => __('Endereço'),
'input' => 'input'
);
$details['cnpj'] = array(
'label' => __('CNPJ'),
'input' => 'input'
);
$details['office_hours'] = array(
'label' => ('Horário de Atendimento'),
'input' => 'input'
);
$details['phone1'] = array(
'label' => __('Telefone 1'),
'input' => 'input'
);
$details['phone2'] = array(
'label' => __('Telefone 2'),
'input' => 'input'
);
$details['email1'] = array(
'label' => __('Email'),
'input' => 'input'
);
$details['twitter'] = array(
'label' => __('URL do Twitter'),
'input' => 'input'
);
$details['facebook'] = array(
'label' => __('URL do Facebook'),
'input' => 'input'
);
$details['instagram'] = array(
'label' => __('URL do Instagram'),
'input' => 'input'
);
$details['youtube'] = array(
'label' => __('URL do Youtube'),
'input' => 'input'
);
return $details;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment