Skip to content

Commit

Permalink
Point "Howdy" link to /me on Default sites (#39113)
Browse files Browse the repository at this point in the history
* Always rewrite profile.php to /me on Default sites

* changelog

* Point "Howdy" link to /me on Default sites

* Remove profile menu link mapping to wp-admin/profile.php
  • Loading branch information
okmttdhr authored Aug 28, 2024
1 parent ac89cef commit 1bc5900
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions projects/packages/jetpack-mu-wpcom/changelog/fix-howdy-link
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Always rewrite profile.php to /me on Default sites
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ public function add_node( $args ) {
return;
}

if ( $args['id'] === 'my-account' ) {
if ( ! is_user_member_of_blog() || get_option( 'wpcom_admin_interface' ) !== 'wp-admin' ) {
$args['href'] = 'https://wordpress.com/me';

// Temporarily point to wpcalypso.wordpress.com for testing purposes.
if ( get_option( 'wpcom_site_level_user_profile' ) === '1' ) {
$args['href'] = 'https://wpcalypso.wordpress.com/me';
}
}
}

$home_url = home_url( '/' );
$site_slug = wp_parse_url( $home_url, PHP_URL_HOST );
$href = str_replace( $home_url, '', $args['href'] );
Expand Down

0 comments on commit 1bc5900

Please sign in to comment.