Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions js/fieldmanager-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ function fmLoadModule( callback ) {
* after the metaboxes are initialized.
*/
const wrappedCallback = () => {
if (document.querySelector('.block-editor-page')) {
const unsubscribeListener = wp.data.subscribe(() => {
if ( document.querySelector( '.block-editor-page' ) ) {
const unsubscribeListener = wp.data.subscribe( () => {
/**
* `areMetaBoxesInitialized` is called immediately before the
* `MetaBoxesArea` component is rendered, which is where the metabox
Expand All @@ -26,12 +26,12 @@ function fmLoadModule( callback ) {
*/
if (
wp.data.select( 'core/edit-post' ).areMetaBoxesInitialized()
&& document.querySelector('.edit-post-meta-boxes-area__container')
&& document.querySelector( '.edit-post-meta-boxes-area__container' )
) {
callback();
unsubscribeListener();
}
});
} );
} else {
callback();
}
Expand Down