Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Oct 26, 2022
1 parent 9ae7287 commit 8c7f5bb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/compat/wordpress-6.2/get-global-styles-and-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ function wp_theme_has_theme_json( $clear_cache = false ) {
}

// Has the own theme a theme.json?
$candidate = get_stylesheet_directory() . '/theme.json';
$theme_has_support = is_readable( $candidate );
$theme_has_support = is_readable( get_stylesheet_directory() . '/theme.json' );

// Has the parent a theme.json if the theme does not?
// Look up the parent if the child does not have a theme.json.
if ( ! $theme_has_support ) {
$candidate = get_template_directory() . '/theme.json';
$theme_has_support = is_readable( $candidate );
$theme_has_support = is_readable( get_template_directory() . '/theme.json' );
}

return $theme_has_support;
Expand Down

0 comments on commit 8c7f5bb

Please sign in to comment.