Remove closure from sidebar registration
This commit is contained in:
@@ -41,6 +41,6 @@
|
|||||||
<!-- Verify that operators have valid spacing surrounding them -->
|
<!-- Verify that operators have valid spacing surrounding them -->
|
||||||
<rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
|
<rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
|
||||||
|
|
||||||
<!-- Force braces to be on the same lines in fuction declarations -->
|
<!-- Force braces to be on the same lines in function declarations -->
|
||||||
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
|
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
|
||||||
</ruleset>
|
</ruleset>
|
||||||
|
|||||||
@@ -69,17 +69,18 @@ add_action('after_setup_theme', function () {
|
|||||||
* Register sidebars
|
* Register sidebars
|
||||||
*/
|
*/
|
||||||
add_action('widgets_init', function () {
|
add_action('widgets_init', function () {
|
||||||
$config = function ($name, $id = '') {
|
$config = [
|
||||||
return [
|
'before_widget' => '<section class="widget %1$s %2$s">',
|
||||||
'name' => __($name, 'sage'),
|
'after_widget' => '</section>',
|
||||||
'id' => 'sidebar-' . $id ?: sanitize_title($name),
|
'before_title' => '<h3>',
|
||||||
'before_widget' => '<section class="widget %1$s %2$s">',
|
'after_title' => '</h3>'
|
||||||
'after_widget' => '</section>',
|
];
|
||||||
'before_title' => '<h3>',
|
register_sidebar([
|
||||||
'after_title' => '</h3>'
|
'name' => __('Primary', 'sage'),
|
||||||
];
|
'id' => 'sidebar-primary'
|
||||||
};
|
] + $config);
|
||||||
|
register_sidebar([
|
||||||
register_sidebar($config('Primary'));
|
'name' => __('Footer', 'sage'),
|
||||||
register_sidebar($config('Footer'));
|
'id' => 'sidebar-footer'
|
||||||
|
] + $config);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user