Enable AUTO assignment of Venue if the Home Team has a default Venue already set.

This commit is contained in:
savvasha
2019-07-30 18:43:20 +03:00
parent 856fbf8a34
commit 970bc812d9

View File

@@ -138,6 +138,11 @@ if ( class_exists( 'WP_Importer' ) ) {
endif; endif;
// Update venue // Update venue
if ( $venue == '' ) {
$team = reset( $teams );
$team_object = get_page_by_title( stripslashes( $team ), OBJECT, 'sp_team' );
$venue = sp_get_the_term_id( $team_object->ID, 'sp_venue' );
}
wp_set_object_terms( $id, $venue, 'sp_venue', false ); wp_set_object_terms( $id, $venue, 'sp_venue', false );
// Update match day // Update match day