theme customizer – Naming Widget Panel


I use this code to name the Widget Panel. It functions good half the time. The other half of the time the Widget Panel loads too fast it seems and the other sections/panels do not show in customizer. So the only section in customizer is Widget Panel half the time and you need to force refresh page for the customizer to load correctly with all the options displaying. Is there a better code to use to avoid this problem?

function widget($wp_customize) {
 $widgets_section = (object) $wp_customize->get_panel('widgets');
 $widgets_section->title = __('My Widget Panel');
 $widgets_section->priority = 110;
add_action('customize_register', 'widget', 110, 1);

Angel Hess 3 months 2022-05-30T22:46:48-05:00 0 Answers 0 views 0

Leave an answer