Customizer keeps hiding custom sections.
-
Hello,
I have custom plugin that adds Customizer sections and options.
The sections can be seen briefly on the customizer screen but then disappear (with added inline css style “display: none;”).I am using the default Twenty Nineteen theme, only active plugin is jQuery updater and my own plugin. I’ve checked my JS code and the hiding is not happening due to my code.
This behavior is happening on all themes (I am using my plugin on other sites).
The way I am setting up the sections, setting and control:
// Add section $wp_customize->add_section('section_id', array( 'title' => 'Section Title', 'priority' => 160, )); // Add settings for a field $wp_customize->add_setting('setting_id', array( 'default' => '', 'transport' => 'refresh', )); // Add the field into a section and assign control $wp_customize->add_control('setting_id', array( 'label' => 'Option Label, 'section' => 'section_id', 'settings' => 'setting_id', 'type' => 'text', ));
As I said, the sections are visible for a second, then all my custom sections are hidden.
Maybe it might be because none of the setting fields are not yet used in the theme but even if I create my own theme (for which this plugin is mainly used) and add
echo get_theme_mod('setting-key')
somewhere in the themes code, the sections are still being hidden by wordpress.Is there some new Customizer API option to keep sections always visible or something that I overlooked? I can’t find anything on google or in WordPress Documentation.
Thank you for your help.
The page I need help with: [log in to see the link]
- The topic ‘Customizer keeps hiding custom sections.’ is closed to new replies.