Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
Fix Jetpack connect bounce
Browse files Browse the repository at this point in the history
  • Loading branch information
earnjam committed Nov 12, 2018
1 parent 2494056 commit 6df52c4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion inc/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,13 @@ function mm_hosting_menu() {
}
add_action( 'admin_menu', 'mm_hosting_menu' );

function mm_jetpack_connect_menu() {
if ( 'bluehost' == mm_brand() ) {
add_submenu_page( null, 'Connect Jetpack', 'Connect Jetpack', 'manage_options', 'mojo-jetpack-connect-bounce', '__return_false' );
}
}
add_action( 'admin_menu', 'mm_jetpack_connect_menu' );

function mm_item_search_menu() {
add_submenu_page( null, 'Search Items', 'Search Items', 'manage_options', 'mojo-search', 'mm_item_search_page' );
}
Expand Down Expand Up @@ -232,7 +239,7 @@ function mm_menu_redirects() {
wp_redirect( 'https://my.bluehost.com/cgi/home', 302 );
} elseif ( 'mojo-jetpack-connect-bounce' == $_GET['page'] ) {
if ( class_exists( 'Jetpack' ) ) {
wp_redirect( Jetpack::build_connection_url(true), 302 );
wp_redirect( Jetpack::init()->build_connect_url( true ), 302 );
} else {
$destination = admin_url( 'admin.php?page=mojo-home' );
}
Expand Down

0 comments on commit 6df52c4

Please sign in to comment.