diff --git a/includes/Flows/Flows.php b/includes/Flows/Flows.php index 3aa9c79..3db6957 100644 --- a/includes/Flows/Flows.php +++ b/includes/Flows/Flows.php @@ -69,8 +69,6 @@ final class Flows { 'siteLogo' => array( 'id' => 0, 'url' => '', - 'fileName' => '', - 'fileSize' => 0, ), // key-value store for social media accounts diff --git a/includes/Services/FlowService.php b/includes/Services/FlowService.php index 412835a..889a7d8 100644 --- a/includes/Services/FlowService.php +++ b/includes/Services/FlowService.php @@ -163,12 +163,15 @@ public static function update_data( $params ) { \update_option( Options::get_option_name( 'blog_description', false ), $data['data']['blogDescription'] ); } - if ( ( ! empty( $data['data']['siteLogo'] ) ) && ! empty( $data['data']['siteLogo']['id'] ) ) { - \update_option( Options::get_option_name( 'site_icon', false ), $data['data']['siteLogo']['id'] ); - \update_option( Options::get_option_name( 'site_logo', false ), $data['data']['siteLogo']['id'] ); + if ( ( 'sitegen' === Data::current_flow() && ! empty( $data['sitegen']['siteLogo'] ) ) && ! empty( $data['sitegen']['siteLogo']['id'] ) ) { + update_option( Options::get_option_name( 'site_icon', false ), $data['sitegen']['siteLogo']['id'] ); + update_option( Options::get_option_name( 'site_logo', false ), $data['sitegen']['siteLogo']['id'] ); + } elseif ( ( ! empty( $data['data']['siteLogo'] ) ) && ! empty( $data['data']['siteLogo']['id'] ) ) { + update_option( Options::get_option_name( 'site_icon', false ), $data['data']['siteLogo']['id'] ); + update_option( Options::get_option_name( 'site_logo', false ), $data['data']['siteLogo']['id'] ); } else { - \update_option( Options::get_option_name( 'site_icon', false ), 0 ); - \delete_option( Options::get_option_name( 'site_logo', false ) ); + update_option( Options::get_option_name( 'site_icon', false ), 0 ); + delete_option( Options::get_option_name( 'site_logo', false ) ); } // Add the version key to the $data before updating to options data.