From 858b325902bed2417cde0623378142cfa5bbae99 Mon Sep 17 00:00:00 2001 From: arunshenoy99 Date: Wed, 28 Feb 2024 14:48:58 +0530 Subject: [PATCH] CR: Update site icon and site logo --- includes/Services/FlowService.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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.