Add duplicate merging option to staff and team importer

This commit is contained in:
Brian Miyaji
2018-01-23 18:16:00 +11:00
parent 413686e4fd
commit c891703e13
3 changed files with 75 additions and 11 deletions

View File

@@ -72,7 +72,7 @@ if ( class_exists( 'WP_Importer' ) ) {
endif;
// Get or insert player
$player_object = get_page_by_title( stripslashes( $name ), OBJECT, 'sp_player' );
$player_object = sp_array_value( $_POST, 'merge', 0 ) ? get_page_by_title( stripslashes( $name ), OBJECT, 'sp_player' ) : false;
if ( $player_object ):
if ( $player_object->post_status != 'publish' ):
wp_update_post( array( 'ID' => $player_object->ID, 'post_status' => 'publish' ) );