).
// If not, a plain textarea will be shown.
if (function_exists('wp_enqueue_code_editor'))
{
/**
* Use the requested type of language, otherwise fallback to PHP if not supplied.
*
* @since 10.1.35
*/
$syntax = !empty($params['syntax']) ? $params['syntax'] : 'php';
/**
* Adjust the syntax according to the WordPress needs.
*
* @since 10.1.48
*/
switch ($syntax)
{
case 'js':
$syntax = 'text/javascript';
break;
}
// enqueue code editor
wp_enqueue_code_editor([
'type' => $syntax,
'codemirror' => $options,
]);
/**
* Inject CodeMirror instance within Joomla.editors pool.
*
* @since 10.1.17
*/
JFactory::getDocument()->addScriptDeclaration(
<<