Code Editor: Check for correct mode value in wp.codeEditor.initialize to enable autocomplete support for PHP.

Props ediamin.
Fixes #47769.

git-svn-id: https://develop.svn.wordpress.org/trunk@45670 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2019-07-25 01:26:13 +00:00
parent 85f0ec3eba
commit d758aa802d

View File

@ -324,7 +324,7 @@ if ( 'undefined' === typeof window.wp.codeEditor ) {
' ' === event.key && /:\s+$/.test( lineBeforeCursor );
} else if ( 'javascript' === innerMode ) {
shouldAutocomplete = isAlphaKey || '.' === event.key;
} else if ( 'clike' === innerMode && 'application/x-httpd-php' === codemirror.options.mode ) {
} else if ( 'clike' === innerMode && 'php' === codemirror.options.mode ) {
shouldAutocomplete = 'keyword' === token.type || 'variable' === token.type;
}
if ( shouldAutocomplete ) {