This slot allows replacing the default main dashboard button in the post editor. It is no longer available in the site editor as of WordPress 6.2.
It’s used for returning back to main wp-admin dashboard when editor is in fullscreen mode.
Please note that this SlotFill is still considered experimental and may change
Examples
Change the icon
This will replace the W icon button in the header with a close icon.
import { registerPlugin } from '@wordpress/plugins';
import { __experimentalMainDashboardButton as MainDashboardButton } from '@wordpress/edit-post';
import { close } from '@wordpress/icons';
const MainDashboardButtonTest = () => (
<MainDashboardButton>
<FullscreenModeClose icon={ close } />
</MainDashboardButton>
);
registerPlugin( 'main-dashboard-button-test', {
render: MainDashboardButtonTest,
} );
Change the icon and link
This example will change the icon in the header to indicate an external link that will take the user to http://wordpress.org when clicked.
import { registerPlugin } from '@wordpress/plugins';
import {
__experimentalFullscreenModeClose as FullscreenModeClose,
__experimentalMainDashboardButton as MainDashboardButton,
} from '@wordpress/edit-post';
import { external } from '@wordpress/icons';
const MainDashboardButtonIconTest = () => (
<MainDashboardButton>
<FullscreenModeClose icon={ external } href="http://wordpress.org" />
</MainDashboardButton>
);
registerPlugin( 'main-dashboard-button-icon-test', {
render: MainDashboardButtonIconTest,
} );