Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WPCOM Admin Bar: Update Edit Site destination #41137

Merged
merged 5 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: changed

Admin Bar: Point the Edit Site menu item to /site-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,20 @@ function wpcom_custom_wpcom_admin_bar_class( $wp_admin_bar_class ) {
return '\Automattic\Jetpack\Jetpack_Mu_Wpcom\WPCOM_Admin_Bar';
}
add_filter( 'wp_admin_bar_class', 'wpcom_custom_wpcom_admin_bar_class' );

/**
* Changes the edit site menu to point to the top-level site editor.
*
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar core object.
*/
function wpcom_edit_site_menu_override( $wp_admin_bar ) {
if ( $wp_admin_bar->get_node( 'site-editor' ) ) {
$args = array(
'id' => 'site-editor',
'href' => admin_url( 'site-editor.php' ),
);

$wp_admin_bar->add_node( $args );
}
}
add_action( 'admin_bar_menu', 'wpcom_edit_site_menu_override', 41 );
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: changed

Admin Bar: Point the Edit Site menu item to /site-editor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: changed

Admin Bar: Point the Edit Site menu item to /site-editor.php
Loading