Add home venue to sample teams

This commit is contained in:
Brian Miyaji
2014-10-22 19:34:18 +11:00
parent 453e212b12
commit c92dd95f53

View File

@@ -131,7 +131,7 @@ class SP_Admin_Sample_Data {
/*
* Insert teams
*/
foreach ( $teams as $team ) {
foreach ( $teams as $index => $team ) {
$post['post_title'] = $team['name'];
$post['post_type'] = 'sp_team';
$post['post_status'] = 'publish';
@@ -144,6 +144,8 @@ class SP_Admin_Sample_Data {
$post['tax_input'][ $taxonomy ] = get_terms( $taxonomy, array( 'hide_empty' => 0, 'fields' => 'ids' ) );
};
$post['tax_input']['sp_venue'] = get_terms( 'sp_venue', array( 'hide_empty' => 0, 'fields' => 'ids', 'orderby' => 'id', 'order' => 'ASC', 'number' => 1, 'offset' => $index ) );
// Insert post
$id = wp_insert_post( $post );