From d758aa802d17f442f89b2fe11acddb494770877e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 25 Jul 2019 01:26:13 +0000 Subject: [PATCH] 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 --- src/js/_enqueues/wp/code-editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/_enqueues/wp/code-editor.js b/src/js/_enqueues/wp/code-editor.js index ea04cea2bc..25a21a5aeb 100644 --- a/src/js/_enqueues/wp/code-editor.js +++ b/src/js/_enqueues/wp/code-editor.js @@ -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 ) {