Skip to content

Commit 2aab389

Browse files
authored
Fix for classic editor (#3013)
* Check for valid return value from wp.data.dispatch.
1 parent 1abbf04 commit 2aab389

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.changelogs/fix_classic-editor.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
significance: patch
2+
type: fixed
3+
links:
4+
- "#3012"
5+
entry: Additional check to avoid conflict with certain plugins alongside the
6+
Classic Editor.

assets/js/private/llms-metaboxes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@
460460
const canEditPost =
461461
wp?.data &&
462462
typeof wp.data.dispatch === 'function' &&
463+
wp.data.dispatch( 'core/editor' ) !== null &&
463464
typeof wp.data.dispatch( 'core/editor' ).editPost === 'function';
464465

465466
if ( ! canEditPost ) {

0 commit comments

Comments
 (0)