Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // page.php
- $pod = pods('contacts');
- $fields = array(
- 'post_title' => array('type'=>'hidden'),
- 'first_name',
- 'last_name',
- 'email_address',
- 'phone'
- );
- echo $pod->form( $fields );
- ?>
- <?php
- // functions.php
- add_filter('pods_api_pre_save_pod_item_contacts', 'contact_create_title', 10, 2);
- function contact_create_title($pieces, $is_new_item) {
- $contact_fullname = $pieces['fields']['first_name']['value'] . ' ' . $pieces['fields']['last_name']['value'];
- $pieces['fields']['post_title']['value'] = $contact_fullname;
- podsDebugger::log_debug_data(print_r($pieces, TRUE));
- return $pieces;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement