Check if logo, sitename, slogan, and secondary links exist How do you check if logo/sitename/slogan &amp; secondary links are enabled from within a function? (outside of preprocess_page)

This seems to work for logo: 

$logo = theme_get_setting('logo');
if (empty($logo)) {
...
}


but this doesn't for secondary links:  

$secondary_links = theme_get_setting('toggle_secondary_links');
if (empty($secondary_link)) {
...
}
$secondary_links = theme_get_setting('toggle_secondary_links'); is working fine.

It doesn't work if secondary menu is disabled form admin/appearance/settings

It works when secondary menu is disabled form admin/appearance/settings/theme-name

OR

It works when secondary menu is disabled form admin/structure/menu/settings source of Source for the Secondary links is set to 'No Secondary links'