Description
Create an oik_contact record programmatically
Usage
oiksp_create_oik_contact( $name, $email, $confirm, $atts );Parameters
- $name
- ( mixed ) required –
- ( mixed ) required –
- $confirm
- ( mixed ) required –
- $atts
- ( mixed ) required –
Returns
voidSource
File name: oik-squeeze/shortcodes/oik-squeeze.phpLines:
1 to 23 of 23
function oiksp_create_oik_contact( $name, $email, $confirm, $atts ) { $post = array( 'post_type' => 'oik_contact' , 'post_title' => "$email - $name" , 'post_name' => "$email" , 'post_content' => "Prospect $name" , 'post_status' => 'private' , 'post_author' => 1 ); /* Set metadata fields */ $_POST['_oiksp_email'] = $email; $_POST['_oiksp_name'] = $name; $_POST['_oiksp_confirm'] = $confirm; if ( $confirm ) { $_POST['_oiksp_status'] = "unconfirmed"; } else { $_POST['_oiksp_status'] = "single"; } $_POST['_oiksp_opted_in'] = $atts['oiksp_id']; $_POST['_oiksp_opted_from'] = $atts['oiksp_from']; $post_id = wp_insert_post( $post, TRUE ); bw_trace2( $post_id ); return( $post_id ); }View on GitHub
