I just solved this on my own site, with 2 fixes:
1. In your themes function.php, add:
remove_action( 'admin_init', 'dm_redirect_admin' );
add_action( 'admin_init', 'theme_redirect_admin' );
function theme_redirect_admin() {
// don't redirect admin ajax calls
if ( strpos( $_SERVER['REQUEST_URI'], 'wp-admin/admin-ajax.php' ) !== false )
return;
// Added 2016-01-25 by CH - && !is_customize_preview()
if ( get_site_option( 'dm_redirect_admin' ) && !is_customize_preview() ) {
// redirect mapped domain admin page to original url
$url = get_original_url( 'siteurl' );
if ( false === strpos( $url, $_SERVER[ 'HTTP_HOST' ] ) ) {
wp_redirect( untrailingslashit( $url ) . $_SERVER[ 'REQUEST_URI' ] );
exit;
}
} else {
global $current_blog;
// redirect original url to primary domain wp-admin/ - remote login is disabled!
$url = domain_mapping_siteurl( false );
$request_uri = str_replace( $current_blog->path, '/', $_SERVER[ 'REQUEST_URI' ] );
if ( false === strpos( $url, $_SERVER[ 'HTTP_HOST' ] ) ) {
wp_redirect( str_replace( '//wp-admin', '/wp-admin', trailingslashit( $url ) . $request_uri ) );
exit;
}
}
}
2. Check this box in the ‘Domain Mapping’ settings:
Redirect administration pages to site's original domain (remote login disabled if this redirect is disabled)
A related note, if you need the Admin Bar links to work, they have to be changed like this for each link Node.
add_action( 'admin_bar_menu', 'customize_admin_links', 999 );
}
function customize_admin_links( $wp_admin_bar ) {
$args = array(
'id' => 'customize',
'href' => 'https://example.com/wp-admin/customize.php',
);
$wp_admin_bar->add_node( $args );
}
Edited for consistent names