Skip to content

Commit

Permalink
Site-Level User Profile: Point the Edit Profile link to wpcalypso.wpr…
Browse files Browse the repository at this point in the history
…dpress.com (#38775)

* Point Edit Profile link to wpcalypso.*

* changelog

* Add comments
  • Loading branch information
okmttdhr authored Aug 8, 2024
1 parent 005121b commit 405d3b8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Point Edit Profile link to wpcalypso.*
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,14 @@ function wpcom_maybe_replace_edit_profile_menu_to_me( $wp_admin_bar ) {
//
// Then, the Edit Profile menu should point to /me, instead of the site's profile.php.
if ( ! is_user_member_of_blog() || get_option( 'wpcom_admin_interface' ) !== 'wp-admin' ) {
$edit_profile_node->href = maybe_add_origin_site_id_to_url( 'https://wordpress.com/me' );

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

$edit_profile_node->href = maybe_add_origin_site_id_to_url( $url );
$wp_admin_bar->add_node( (array) $edit_profile_node );
}
}
Expand All @@ -189,12 +196,19 @@ function wpcom_add_my_account_item_to_profile_menu( $wp_admin_bar ) {
// Adds the 'My Account' menu item before 'Log Out'.
$wp_admin_bar->remove_node( 'logout' );
}

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

$wp_admin_bar->add_node(
array(
'id' => 'wpcom-profile',
'parent' => 'user-actions',
'title' => __( 'My Account', 'jetpack-mu-wpcom' ),
'href' => maybe_add_origin_site_id_to_url( 'https://wordpress.com/me/account' ),
'href' => maybe_add_origin_site_id_to_url( $url ),
)
);

Expand Down

0 comments on commit 405d3b8

Please sign in to comment.