Skip to content

Commit 2f9fe48

Browse files
authored
Fix block validation for 6.2 (#272)
1 parent 342675c commit 2f9fe48

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

assets/src/js/_acf-validation.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,9 +1162,11 @@
11621162
'editor-post-publish-panel'
11631163
)[ 0 ];
11641164
if ( publishPanel ) {
1165+
// See https://github.com/WordPress/secure-custom-fields/pull/272
1166+
// `togglePublishSidebar` was only introduced in WP 6.6, it should be optional
11651167
wp.data
11661168
.dispatch( 'core/editor' )
1167-
.togglePublishSidebar();
1169+
.togglePublishSidebar?.();
11681170
}
11691171

11701172
// Add block to errors array

0 commit comments

Comments
 (0)