-
-
Save emohamed/dc2ec95d1829a8c70dae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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