Skip to content

Instantly share code, notes, and snippets.

@emohamed
Forked from Avakulenko/Carbon_Group.php
Last active October 28, 2015 07:42
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 emohamed/dc2ec95d1829a8c70dae to your computer and use it in GitHub Desktop.
Save emohamed/dc2ec95d1829a8c70dae to your computer and use it in GitHub Desktop.
<?php
Carbon_Field::register_namespace('location', function ($type, $name, $label) {
return Carbon_Field::factory($type, $name, $label)
->set_conditional_logic(array(
'relation' => 'AND',
array(
'field' => 'crb_user_location_type',
'value' => 'fixed',
'compare' => '=',
)
))
->set_width(33.3)
->add_class('example-meta');
})
Carbon_Container::factory('user_meta', 'User Additional Info')
->add_fields(array(
Carbon_Field::factory('text', 'crb_user_phone', 'Phone'),
Carbon_Field::factory('select', 'crb_user_location_type', 'Location Type')->add_options(array(
'flexible' => 'Flexible Location',
'fixed' => 'Fixed Location',
)),
Carbon_Field::factory('location:text', 'crb_user_location_address', 'Location Address'),
Carbon_Field::factory('location:text', 'crb_user_location_lat', 'Location Lat'),
Carbon_Field::factory('location:text', 'crb_user_location_lng', 'Location Lng'),
Carbon_Field::factory('location:text', 'crb_user_hours_mon', 'Monday Hours'),
Carbon_Field::factory('location:text', 'crb_user_hours_tues', 'Tuesday Hours'),
Carbon_Field::factory('location:text', 'crb_user_hours_wed', 'Wednesday Hours'),
Carbon_Field::factory('location:text', 'crb_user_hours_thurs', 'Thursday Hours'),
Carbon_Field::factory('location:text', 'crb_user_hours_fri', 'Friday Hours'),
Carbon_Field::factory('location:text', 'crb_user_hours_sat', 'Saturday Hours'),
Carbon_Field::factory('location:text', 'crb_user_hours_sun', 'Sunday Hours'),
Carbon_Field::factory('text', 'crb_user_primary_email', 'Primary Email'),
Carbon_Field::factory('attachment', 'crb_profile_avatar', 'Profile Avatar'),
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment