/**
* Render the settings for the current section
*
* @since 2.0.0
*/
public function output()
{
$settings = $this->get_settings();
// inject the actual setting value before outputting the fields
// ::output_fields() uses get_option() but customizations are stored
// in a single option so this dynamically returns the correct value
if (isset($_GET['section']) && $_GET['section'] == 'email_options') {
// email options
$wc_emails = (array) WC_Emails::instance()->emails;
foreach (self::$wc_emails_enabled as $filed => $id) {
$email_enabled = (array) $wc_emails[$filed];
if ($email_enabled['enabled'] == 'no') {
add_filter("pre_option_{$filed}", function () {
return 'no';
});
} else {
add_filter("pre_option_{$filed}", function () {
return 'yes';
});
}
}
}
if (isset($_GET['section']) && $_GET['section'] == 'sms_options') {
}
foreach ($this->customizations as $filter => $value) {
add_filter("pre_option_{$filter}", array($this, 'get_customization'));
}
WC_Admin_Settings::output_fields($settings);
}