Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes issue with site-logo when option is unset #32092

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ function gutenberg_auto_draft_get_sample_permalink( $permalink, $id, $title, $na
'schema' => array(
'type' => 'object',
'properties' => array(
'custom_logo' => array( 'type' => 'integer' ),
'custom_logo' => array(
'type' => array( 'integer', 'boolean' ),
),
),
),
),
Expand Down Expand Up @@ -234,6 +236,7 @@ function gutenberg_rest_pre_get_setting_filter_custom_logo( $result, $name ) {
'custom_logo' => get_theme_mod( 'custom_logo' ),
);
}
return $result;
}
add_filter( 'rest_pre_get_setting', 'gutenberg_rest_pre_get_setting_filter_custom_logo', 10, 2 );

Expand All @@ -258,6 +261,7 @@ function gutenberg_rest_pre_set_setting_filter_theme_mods( $result, $name, $valu
update_option( $theme_mods_setting_name, $value );
return true;
}
return $result;
}

add_filter( 'rest_pre_update_setting', 'gutenberg_rest_pre_set_setting_filter_theme_mods', 10, 3 );