| @@ 340-343 (lines=4) @@ | ||
| 337 | return $suppress_errors ? false : new WP_Error( 'no_token_for_user', sprintf( __( 'No token for user %d', 'jetpack' ), $user_id ) ); | |
| 338 | } | |
| 339 | $user_token_chunks = explode( '.', $user_tokens[ $user_id ] ); | |
| 340 | 			if ( empty( $user_token_chunks[1] ) || empty( $user_token_chunks[2] ) ) { | |
| 341 | // translators: %s is the user ID. | |
| 342 | return $suppress_errors ? false : new WP_Error( 'token_malformed', sprintf( __( 'Token for user %d is malformed', 'jetpack' ), $user_id ) ); | |
| 343 | } | |
| 344 | 			if ( $user_token_chunks[2] !== (string) $user_id ) { | |
| 345 | // translators: %1$d is the ID of the requested user. %2$d is the user ID found in the token. | |
| 346 | return $suppress_errors ? false : new WP_Error( 'user_id_mismatch', sprintf( __( 'Requesting user_id %1$d does not match token user_id %2$d', 'jetpack' ), $user_id, $user_token_chunks[2] ) ); | |
| @@ 163-165 (lines=3) @@ | ||
| 160 | remove_submenu_page( 'index.php', 'index.php' ); | |
| 161 | ||
| 162 | // Only add submenu when there are other submenu items. | |
| 163 | 		if ( ! empty( $submenu['index.php'] ) ) { | |
| 164 | add_submenu_page( $menu_slug, __( 'My Home', 'jetpack' ), __( 'My Home', 'jetpack' ), $cap, $menu_slug, null, 0 ); | |
| 165 | } | |
| 166 | ||
| 167 | $this->migrate_submenus( 'index.php', $dashboard_menu_item[2] ); | |
| 168 | add_filter( | |