Assuming i've got a bunch of setting sections. I add these sections to my plugin page in the following way.
$sections = array('notifcations', 'updates');
foreach ($sections as $section)
{
add_settings_section(
$section .'_section',
$section,
array( $this, 'disable_callback_warnings' ),
'sgnc'
);
}
Everything works as expected but i wonder how to localise the section headline? As far as i know i can't pass any variables to the locale functions _e()
and __()
. So this won't work:
$sections = array('notifcations', 'updates');
foreach ($sections as $section)
{
add_settings_section(
$section .'_section',
__($section),
array( $this, 'disable_callback_warnings' ),
'sgnc'
);
}
http://codex.wordpress.org/Function_Reference/add_settings_section