function openLinksInParentFrame() {
	const viewPostLinkSelectors = [
		'.components-notice-list .is-success .components-notice__action.is-link', // View Post link in success notice
		'.post-publish-panel__postpublish .components-panel__body.is-opened a', // Post title link in publish panel
		'.components-panel__body.is-opened .post-publish-panel__postpublish-buttons a.components-button', // View Post button in publish panel
	].join( ',' );
	$( '#editor' ).on( 'click', viewPostLinkSelectors, e => {
		e.preventDefault();
		window.open( e.target.href, '_top' );
	} );

	if ( calypsoifyGutenberg.manageReusableBlocksUrl ) {
		const manageReusableBlocksLinkSelectors = [
			'.editor-inserter__manage-reusable-blocks', // Link in the Blocks Inserter
			'a.components-menu-item__button[href*="post_type=wp_block"]', // Link in the More Menu
		].join( ',' );
		$( '#editor' ).on( 'click', manageReusableBlocksLinkSelectors, e => {
			e.preventDefault();
			window.open( calypsoifyGutenberg.manageReusableBlocksUrl, '_top' );
		} );
	}
}
function openLinksInParentFrame() {
	const viewPostLinkSelectors = [
		'.components-notice-list .is-success .components-notice__action.is-link', 
		'.post-publish-panel__postpublish .components-panel__body.is-opened a', 
		'.components-panel__body.is-opened .post-publish-panel__postpublish-buttons a.components-button', 
	].join( ',' );
	$( '#editor' ).on( 'click', viewPostLinkSelectors, e => {
		e.preventDefault();
		window.open( e.target.href, '_top' );
	} );

	if ( calypsoifyGutenberg.manageReusableBlocksUrl ) {
		const manageReusableBlocksLinkSelectors = [
			'.editor-inserter__manage-reusable-blocks', 
			'a.components-menu-item__button[href*="post_type=wp_block"]', 
		].join( ',' );
		$( '#editor' ).on( 'click', manageReusableBlocksLinkSelectors, e => {
			e.preventDefault();
			window.open( calypsoifyGutenberg.manageReusableBlocksUrl, '_top' );
		} );
	}
}
function openLinksInParentFrame ( ) { const viewPostLinkSelectors = [ '.components-notice-list .is-success .components-notice__action.is-link' , // View Post link in success notice '.post-publish-panel__postpublish .components-panel__body.is-opened a' , // Post title link in publish panel '.components-panel__body.is-opened .post-publish-panel__postpublish-buttons a.components-button' , // View Post button in publish panel ] . join ( ',' ) ; $ ( '#editor' ) . on ( 'click' , viewPostLinkSelectors , e => { e . preventDefault ( ) ; window . open ( e . target . href , '_top' ) ; } ) ; if ( calypsoifyGutenberg . manageReusableBlocksUrl ) { const manageReusableBlocksLinkSelectors = [ '.editor-inserter__manage-reusable-blocks' , // Link in the Blocks Inserter 'a.components-menu-item__button[href*="post_type=wp_block"]' , // Link in the More Menu ] . join ( ',' ) ; $ ( '#editor' ) . on ( 'click' , manageReusableBlocksLinkSelectors , e => { e . preventDefault ( ) ; window . open ( calypsoifyGutenberg . manageReusableBlocksUrl , '_top' ) ; } ) ; } }
Modify links in order to open them in parent window and not in a child iframe.
Modify links in order to open them in parent window and not in a child iframe .