Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#27513 closed defect (bug) (invalid)

Widget Customizer: - Control Sections do not show if sidebar id do not start with 'sidebar' name

Reported by: alexvorn2's profile alexvorn2 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Widgets Keywords:
Focuses: Cc:

Description

.control-sections do not show on on wp-admin/customize.php page for the sidebars IF the sidebar id's do not start with a 'sidebar' name.

How to replicate:

replace:
sidebar-1, sidebar-2 and sidebar-3
with:
name-sidebar-1, name-sidebar-2 and name-sidebar-3

See the function where to replace:

function twentyfourteen_widgets_init() {
	require get_template_directory() . '/inc/widgets.php';
	register_widget( 'Twenty_Fourteen_Ephemera_Widget' );

	register_sidebar( array(
		'name'          => __( 'Primary Sidebar', 'twentyfourteen' ),
		'id'            => 'sidebar-1',
		'description'   => __( 'Main sidebar that appears on the left.', 'twentyfourteen' ),
		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
		'after_widget'  => '</aside>',
		'before_title'  => '<h1 class="widget-title">',
		'after_title'   => '</h1>',
	) );
	register_sidebar( array(
		'name'          => __( 'Content Sidebar', 'twentyfourteen' ),
		'id'            => 'sidebar-2',
		'description'   => __( 'Additional sidebar that appears on the right.', 'twentyfourteen' ),
		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
		'after_widget'  => '</aside>',
		'before_title'  => '<h1 class="widget-title">',
		'after_title'   => '</h1>',
	) );
	register_sidebar( array(
		'name'          => __( 'Footer Widget Area', 'twentyfourteen' ),
		'id'            => 'sidebar-3',
		'description'   => __( 'Appears in the footer section of the site.', 'twentyfourteen' ),
		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
		'after_widget'  => '</aside>',
		'before_title'  => '<h1 class="widget-title">',
		'after_title'   => '</h1>',
	) );
}
add_action( 'widgets_init', 'twentyfourteen_widgets_init' );

in functions.php file of Twenty Fourteen theme and go to wp-admin/customize.php and you will see that control sections do not show for these sidebars.

I'm using the latest trac version.

Change History (5)

#1 follow-up: @westonruter
11 years ago

@alexvorn2: When you did your replacements, did you likewise replace the dynamic_sidebar() calls to use the new sidebar IDs? If not, then the above behavior is expected because the widget area sections in the customizer only appear when previewing a template that uses them.

#2 in reply to: ↑ 1 @alexvorn2
11 years ago

Replying to westonruter:

@alexvorn2: When you did your replacements, did you likewise replace the dynamic_sidebar() calls to use the new sidebar IDs? If not, then the above behavior is expected because the widget area sections in the customizer only appear when previewing a template that uses them.

NO
I did not knew about that...

Last edited 11 years ago by alexvorn2 (previous) (diff)

#3 @alexvorn2
11 years ago

  • Resolution set to invalid
  • Status changed from new to closed

So I close this :)

#4 @alexvorn2
11 years ago

  • Version trunk deleted

#5 @ocean90
11 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.