I would like to use an addon of Codemirror in the customizer of WordPress.

I have already register a textarea in the customizer, but how can I use an addon of Codemirror like the fullscreen? https://codemirror.net/demo/fullscreen.html

$wp_customize->add_setting( 'my_theme_customizer_code_js', array(
    'type' => 'option',
) );

$wp_customize->add_control( new WP_Customize_Code_Editor_Control( $wp_customize, 'my_theme_customizer_code_js', array(
    'label'     => 'JavaScript',
    'description' => esc_html( 'Add custom JavaScript to your site.'),
    'code_type' => 'javascript',
    'settings'  => 'my_theme_customizer_code_js',
    'section'   => 'my_customizer_section',
) ) );


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.