diff --git a/includes/controls/class-kirki-controls-code-control.php b/includes/controls/class-kirki-controls-code-control.php index 57dec4c21..e16ff77e5 100644 --- a/includes/controls/class-kirki-controls-code-control.php +++ b/includes/controls/class-kirki-controls-code-control.php @@ -71,6 +71,9 @@ public function enqueue() { wp_enqueue_script( 'codemirror-language-javascript', trailingslashit( Kirki::$url ) . 'assets/js/vendor/codemirror/mode/javascript/javascript.js', array( 'jquery', 'codemirror' ) ); wp_enqueue_script( 'codemirror-language-css', trailingslashit( Kirki::$url ) . 'assets/js/vendor/codemirror/mode/css/css.js', array( 'jquery', 'codemirror' ) ); wp_enqueue_script( 'codemirror-language-htmlmixed', trailingslashit( Kirki::$url ) . 'assets/js/vendor/codemirror/mode/htmlmixed/htmlmixed.js', array( 'jquery', 'codemirror', 'codemirror-multiplex', 'codemirror-language-xml', 'codemirror-language-javascript', 'codemirror-language-css' ) ); + } elseif ( 'php' === $this->choices['language'] ) { + wp_enqueue_script( 'codemirror-language-xml', trailingslashit( Kirki::$url ) . 'assets/js/vendor/codemirror/mode/xml/xml.js', array( 'jquery', 'codemirror' ) ); + wp_enqueue_script( 'codemirror-language-php', trailingslashit( Kirki::$url ) . 'assets/js/vendor/codemirror/mode/php/php.js', array( 'jquery', 'codemirror' ) ); } else { // Add language script. wp_enqueue_script( 'codemirror-language-' . $this->choices['language'], trailingslashit( Kirki::$url ) . 'assets/js/vendor/codemirror/mode/' . $this->choices['language'] . '/' . $this->choices['language'] . '.js', array( 'jquery', 'codemirror' ) );