Reply To: Issue with adding sidebars

#21171
bernard
Participant

Just highlighting in bold the exact line # 310 below:

if( ! isset( $_GET[‘sidebar’] ) ) {
add_settings_section(
‘sidebar_locations’, // Unique identifier for the settings section
__( ‘Sidebar Locations’, ‘enlightenment’ ), // Section title
‘__return_false’, // Section callback (we don’t want anything)
‘enlightenment_theme_options’ // Menu slug, used to uniquely identify the page
);
add_settings_field(
‘select_template’, // Unique identifier for the field for this section
__( ‘Select Template to Edit’, ‘enlightenment’ ), // Setting field label
‘enlightenment_unlimited_sidebars_select_template’, // Function that renders the settings field
‘enlightenment_theme_options’, // Menu slug, used to uniquely identify the page
‘sidebar_locations’, // Settings section. Same as the first argument in the add_settings_section() above
array(
‘name’ => ‘select_template’,
‘class’ => ‘select-template’,
‘value’ => enlightenment_unlimited_sidebars_current_template(),
)
);
$locations = enlightenment_sidebar_locations();
$template = enlightenment_unlimited_sidebars_current_template();
foreach( $locations[$template] as $location => $sidebar ) {
add_settings_field(
‘edit_sidebar_location_’ . $location, // Unique identifier for the field for this section
$sidebar[‘name’], // Setting field label
‘enlightenment_edit_sidebar_location’, // Function that renders the settings field
‘enlightenment_theme_options’, // Menu slug, used to uniquely identify the page
‘sidebar_locations’, // Settings section. Same as the first argument in the add_settings_section() above
array(
‘name’ => ‘sidebar_locations[‘ . $template . ‘][‘ . $location . ‘]’,
‘value’ => $sidebar[‘sidebar’],
‘description’ => ”,