Description
Insert an oik-track with the fields provided, creating the album (oik-recording) as required <pre> result Array ( [_oikt_album] => A Night's Tale [_oikt_artist] => Caravan [_oikt_composer] => Pye Hastings [_oikt_duration] => 11:29 [_oikt_title] => All the Way/A Very Smelly Grubby Little Oik [_oikt_track] => 1 [_oikt_year] => 2003 [_oikt_publisher] => Classic Rock Legends [_oikt_MPCI] => {D1607DBC-E323-4BE2-86A1-48A42A28441E} [_oikt_URI] = AMGa_id=R 654019;AMGp_id=P 16292 [_oikt_UFI] = AMGa_id=R 654019;AMGp_id=P 16292;AMGt_id=T 6661543 ) </pre>
Usage
oik_tunes_insert_track( $result );Parameters
- $result
- ( mixed ) required –
Returns
voidSource
File name: oik-tunes/admin/oik-tunes.phpLines:
1 to 20 of 20
function oik_tunes_insert_track( $result ) { $oikt_album = oik_tunes_query_recording( $result ); $content = oik_tunes_create_track_content( $result, $oikt_album ); $post = array( 'post_type' => "oik-track" , 'post_title' => $result['_oikt_title'] , 'post_name' => $result['_oikt_title'] , 'post_content' => $content , 'post_status' => 'publish' , 'post_date' => oik_tunes_create_post_date( $result ) ); /* Set metadata fields */ $_POST['_oikt_recording'] = $oikt_album; $_POST['_oikt_track'] = bw_array_get( $result, "_oikt_track", null ); $_POST['_oikt_duration'] = bw_array_get( $result, "_oikt_duration", null ); $_POST['_oikt_composer'] = bw_array_get( $result, "_oikt_composer", null ); $_POST['_oikt_UFI'] = bw_array_get( $result, "_oikt_UFI", null ); $post_id = wp_insert_post( $post, TRUE ); bw_trace2( $post_id ); return( $post_id ); }View on GitHub
Invoked by
Calls
1 to 4 of 4
- bw_trace2() – Trace $value to the trace log file if tracing is active
- oik_tunes_create_post_date() – Conjure up a post_date based on the year, track number and duration
- oik_tunes_create_track_content() – Create the content field for an oik-track
- oik_tunes_query_recording() – Determine the post_id of the oik-recording based on:
Call hooks
API Letters:
