Skip to content

Commit

Permalink
Custom CSS: remove outdated link from admin menu (#39169)
Browse files Browse the repository at this point in the history
* Custom CSS: remove outdated link from admin menu

* changelog
  • Loading branch information
monsieur-z authored Sep 2, 2024
1 parent 41437f3 commit 3831340
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Custom CSS: remove outdated link from admin menu
19 changes: 0 additions & 19 deletions projects/plugins/jetpack/class.jetpack-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,6 @@ class_exists( 'Jetpack' ) && (
// Add in our new page slug that will redirect to the customizer.
$hook = add_theme_page( __( 'CSS', 'jetpack' ), __( 'Additional CSS', 'jetpack' ), 'edit_theme_options', 'editcss-customizer-redirect', array( __CLASS__, 'customizer_redirect' ) );
add_action( "load-{$hook}", array( __CLASS__, 'customizer_redirect' ) );
} elseif ( class_exists( 'Jetpack' ) && Jetpack::is_connection_ready() ) { // Link to the Jetpack Settings > Writing page, highlighting the Custom CSS setting.
add_submenu_page( '', __( 'CSS', 'jetpack' ), __( 'Additional CSS', 'jetpack' ), 'edit_theme_options', 'editcss', array( __CLASS__, 'theme_enhancements_redirect' ) );

$hook = add_theme_page( __( 'CSS', 'jetpack' ), __( 'Additional CSS', 'jetpack' ), 'edit_theme_options', 'editcss-theme-enhancements-redirect', array( __CLASS__, 'theme_enhancements_redirect' ) );
add_action( "load-{$hook}", array( __CLASS__, 'theme_enhancements_redirect' ) );
}
}

Expand All @@ -183,20 +178,6 @@ public static function customizer_redirect() {
exit;
}

/**
* Handle the Additional CSS redirect to the Jetpack settings Theme Enhancements section.
*
* @since 11.0
*
* @return never
*/
public static function theme_enhancements_redirect() {
wp_safe_redirect(
'admin.php?page=jetpack#/writing?term=custom-css'
);
exit;
}

/**
* Build the URL to deep link to the Customizer.
*
Expand Down

0 comments on commit 3831340

Please sign in to comment.