Tab for domain mapping not showing anymore
0x7466 opened this issue · comments
Since the update to WordPress 5.5 or so the domain mapping tab is missing.
However, if I visit the domain mapping url (eg. domain/wp-admin/network/admin.php?action=mercator-aliases&id=1) directly, it opens up normally.
Looks like there is something wrong in this function in the admin.php
:
/**
* Output the site tab if we're on the right page
*
* Outputs the link, then moves it into place using JS, as there are no hooks to
* speak of.
*/
function maybe_output_site_tab() {
if ( ! is_network_admin() ) {
return;
}
if ( $GLOBALS['parent_file'] !== 'sites.php' || $GLOBALS['submenu_file'] !== 'sites.php' ) {
return;
}
$id = isset( $_REQUEST['id'] ) ? absint( $_REQUEST['id'] ) : 0;
if ( empty( $id ) ) {
return;
}
$class = ( ! empty( $_REQUEST['action'] ) && in_array( $_REQUEST['action'], array( 'mercator-aliases', 'mercator-edit' ), true ) ) ? ' nav-tab-active' : '';
?>
<span id="mercator-aliases-nav-link" class="hide-if-no-js"><a href="<?php echo esc_url( network_admin_url( 'admin.php?action=mercator-aliases' ) . '&id=' . $id ); ?>" class="nav-tab<?php echo $class; ?>"><?php esc_html_e( 'Aliases', 'mercator' ); ?></a></span>
<script>jQuery(function ($) {
$( '#mercator-aliases-nav-link' ).appendTo( $( '.nav-tab-wrapper' ) );
});</script>
<?php
}
Is it possible that the structure of the admin site has changed and now the inclusion doesn't work anymore?
Thanks!
i can confirm that the Aliases tab is missing, but I'm not sure if it's due to WP 5.5.0+. I have 2 nearly identical WMPU installs. Both have 5.5.1 installed, but have different versions of WooCommerce and several other plugins. The MU install with the older version of the plugins is the one that's still displaying the tab.
Can't confirm this one. You might be running a plugin that has a JS error and is preventing the following from firing:
Lines 77 to 79 in 55e3f01
Check your browser's developer console to see if there are any JS errors.
I wasn't seeing any console errors on any of the tabs. But, when I manually added the aliases URI (admin.php?action=mercator-aliases), the following popped up:
[DOM] Found 2 elements with non-unique id #_wpnonce: (More info: https://goo.gl/9p2vKq) <input type="hidden" id="_wpnonce" name="_wpnonce" value="e25c55abc0">
<input type="hidden" id="_wpnonce" name="_wpnonce" value="f7ff686452">
As I implied in my previous post, it would appear that there's a conflict with one of the updated plugins. My hunch is on WooCommerce.