Skip to content

Commit

Permalink
Footer credit: Remove customizer option for block themes (take 2) (#3…
Browse files Browse the repository at this point in the history
…8559)

Reintroduces the removal of the "Footer Credit" option from the Customizer for block themes (#38473) which was reverted in #38557 since it caused fatal errors on sites with child themes.

To prevent the fatal errors, we know wait for the `init` action before checking `wp_is_block_theme`.

Props to @Automattic/lego for finding the culprit.
  • Loading branch information
mmtr authored Jul 26, 2024
1 parent 53b8c44 commit 04a2033
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: removed

Footer credit: Remove customizer option for block themes
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,13 @@ function footercredits_sanitize_setting( $val ) {
}
}

// Setup the Theme Customizer settings and controls...
add_action( 'customize_register', 'footercredits_register', 99 );
/**
* Setup the Footer Credit customizer settings and controls for classic themes only.
* We don't support the footer credit on block themes, see https://wp.me/paYJgx-51l.
*/
function footercredits_init() {
if ( ! wp_is_block_theme() ) {
add_action( 'customize_register', 'footercredits_register', 99 );
}
}
add_action( 'init', 'footercredits_init' );

0 comments on commit 04a2033

Please sign in to comment.