Skip to content

Commit

Permalink
Monetize: Move menu item under the Jetpack menu for all Classic inter…
Browse files Browse the repository at this point in the history
…face users (#36995)

* Monetize: Move to Jetpack menu to all Classic interface users

* changelog
  • Loading branch information
lupus2k authored Apr 22, 2024
1 parent 7e20e6c commit 222c807
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: changed

Monetize: Move menu item under Jetpack menu for all Classic interface users
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Automattic\Jetpack\Jetpack_Mu_Wpcom;
use Automattic\Jetpack\Redirect;
use Automattic\Jetpack\Status;
use Automattic\Jetpack\Status\Host;

/**
* Check if the current user has a WordPress.com account connected.
Expand Down Expand Up @@ -217,7 +218,11 @@ function add_all_sites_menu_to_masterbar( $wp_admin_bar ) {
* Add the WordPress.com submenu items related to Jetpack under the Jetpack menu on the wp-admin sidebar.
*/
function wpcom_add_jetpack_menu_item() {
if ( ! function_exists( 'wpcom_is_nav_redesign_enabled' ) || ! wpcom_is_nav_redesign_enabled() ) {
/*
* Do not display any menu on WoA and WordPress.com Simple sites (unless Classic wp-admin is enabled).
* They already get a menu item under Users via nav-unification.
*/
if ( ( new Host() )->is_wpcom_platform() && get_option( 'wpcom_admin_interface' ) !== 'wp-admin' ) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Monetize: Move menu item under Jetpack menu for all Classic interface users
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,9 @@ public function add_tools_menu() {
$this->hide_submenu_page( 'tools.php', 'delete-blog' );

add_submenu_page( 'tools.php', esc_attr__( 'Marketing', 'jetpack' ), __( 'Marketing', 'jetpack' ), 'publish_posts', 'https://wordpress.com/marketing/tools/' . $this->domain, null, 0 );
add_submenu_page( 'tools.php', esc_attr__( 'Monetize', 'jetpack' ), __( 'Monetize', 'jetpack' ), 'manage_options', 'https://wordpress.com/earn/' . $this->domain, null, 1 );
if ( ! $this->use_wp_admin_interface() ) {
add_submenu_page( 'tools.php', esc_attr__( 'Monetize', 'jetpack' ), __( 'Monetize', 'jetpack' ), 'manage_options', 'https://wordpress.com/earn/' . $this->domain, null, 1 );
}
}

/**
Expand Down

0 comments on commit 222c807

Please sign in to comment.