Skip to content

Commit

Permalink
Admin menu: add link to Customizer in sites with block-based theme an…
Browse files Browse the repository at this point in the history
…d custom CSS (#37761)

Co-authored-by: Karen Attfield <karenlattfield@gmail.com>
  • Loading branch information
monsieur-z and coder-karen authored Jun 10, 2024
1 parent 92b2349 commit 8ede0e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Admin menu: add link to Customizer in sites with block-based theme and custom CSS
7 changes: 6 additions & 1 deletion projects/plugins/jetpack/class.jetpack-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,12 @@ public static function additional_css_menu() {
// See https://github.com/Automattic/jetpack/pull/19965 for more on how this menu item is dealt with on WoA sites.
if ( ( new Host() )->is_woa_site() && ! ( in_array( 'custom-css', Jetpack::get_available_modules(), true ) ) ) {
return;
} elseif ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'custom-css' ) ) { // If the Custom CSS module is enabled, add the Additional CSS menu item and link to the Customizer.
} elseif (
class_exists( 'Jetpack' ) && (
Jetpack::is_module_active( 'custom-css' ) || // If the Custom CSS module is enabled, add the Additional CSS menu item and link to the Customizer.
( wp_is_block_theme() && ! empty( wp_get_custom_css() ) ) // Do the same if the theme is block-based but has existing custom CSS.
)
) {
// Add in our legacy page to support old bookmarks and such.
add_submenu_page( '', __( 'CSS', 'jetpack' ), __( 'Additional CSS', 'jetpack' ), 'edit_theme_options', 'editcss', array( __CLASS__, 'customizer_redirect' ) );

Expand Down

0 comments on commit 8ede0e4

Please sign in to comment.