Skip to content

Commit

Permalink
CR: Update site icon and site logo
Browse files Browse the repository at this point in the history
  • Loading branch information
arunshenoy99 committed Feb 28, 2024
1 parent 9366330 commit 858b325
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions includes/Services/FlowService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 858b325

Please sign in to comment.