0

I am trying to create a custom field (text/CSS code in textarea) that include the CSS suggestion like Additional CSS in the customizer: https://i.postimg.cc/9QhLPgVk/image.png.

Does everybody has experience with that?

I need any solution like the above screenshot here: https://i.postimg.cc/L55cpChD/image.png.

1

1 Answer 1

0

As it happens, I was literally just doing some stuff with the customizer.

You can use the following class to get what you need..

WP_Customize_Code_Editor_Control

I'll include it in the control ready to go.

$wp_customize->add_control( new WP_Customize_Code_Editor_Control( $wp_customize, 'favorite_html', array(
        'label' => 'Theme CSS',
        'description' => '',
        'code_type' => 'text/css',
        'section' => 'section_id',
        'settings' => 'settings_control'
    )));
1
  • Thank you so much, Steve, I missed WP_Customize_Code_Editor_Control on my own code. I appreciate it.
    – Gabriel
    Jun 4, 2021 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.