Skip to content

Commit

Permalink
WPCOM Admin Bar: Update Edit Site destination (#41137)
Browse files Browse the repository at this point in the history
* Admin Bar: Update Edit Site link to point to site-editor.php

* changelog

* bump action priority

* admin_url

* more intentional hook priority
  • Loading branch information
dereksmart authored Jan 17, 2025
1 parent b0808fa commit 2aa3651
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
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

0 comments on commit 2aa3651

Please sign in to comment.