Skip to content

Commit e29d2b4

Browse files
committed
Hide onboarding restart cards
hide in Bluehost page and themes.php
1 parent 71aa8e9 commit e29d2b4

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

includes/WP_Admin.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public function __construct() {
3333
\add_action( 'admin_menu', array( __CLASS__, 'register_page' ) );
3434
\add_action( 'load-dashboard_page_' . self::$slug, array( __CLASS__, 'page_title' ), 9, 1 );
3535
\add_action( 'load-dashboard_page_' . self::$slug, array( __CLASS__, 'initialize' ) );
36+
\add_action( 'load-toplevel_page_bluehost', array( __CLASS__, 'hide_onboarding_restart_card' ) );
3637
\add_action( 'load-themes.php', array( __CLASS__, 'can_restart_onboarding' ) );
3738
if ( 'sitegen' === Data::current_flow() ) {
3839
\add_action( 'load-themes.php', array( __CLASS__, 'mark_sitegen_generated_themes' ) );
@@ -317,7 +318,38 @@ public static function can_restart_onboarding(): void {
317318
'all'
318319
);
319320

321+
/**
322+
* Temporary: hide the build with ai button
323+
*/
324+
wp_add_inline_style(
325+
'onboarding-restart-button',
326+
'.themes .theme.build-with-ai {
327+
display: none !important;
328+
}'
329+
);
330+
320331
\wp_enqueue_script( 'onboarding-restart-button' );
321332
\wp_enqueue_style( 'onboarding-restart-button' );
322333
}
334+
335+
/**
336+
* Temporary: Enqueue scripts that hides the build with ai button
337+
*
338+
* @return void
339+
*/
340+
public static function hide_onboarding_restart_card(): void {
341+
\wp_register_style(
342+
'hide-onboarding-restart-card',
343+
false,
344+
);
345+
346+
\wp_add_inline_style(
347+
'hide-onboarding-restart-card',
348+
'div[data-testid="restartOnboarding"] {
349+
display: none !important;
350+
}'
351+
);
352+
353+
\wp_enqueue_style( 'hide-onboarding-restart-card' );
354+
}
323355
} // END /NewfoldLabs/WP/Module/Onboarding/Admin()

0 commit comments

Comments
 (0)