get_label(); } /** * Output HTML of the misc settings. * * @since 1.0.0 */ public function display() { $options = Options::init(); ?>
check_admin_referer(); $options = Options::init(); // Unchecked checkboxes doesn't exist in $_POST, so we need to ensure we actually have them in data to save. if ( empty( $data['general']['do_not_send'] ) ) { $data['general']['do_not_send'] = false; } if ( empty( $data['general']['am_notifications_hidden'] ) ) { $data['general']['am_notifications_hidden'] = false; } if ( empty( $data['general']['email_delivery_errors_hidden'] ) ) { $data['general']['email_delivery_errors_hidden'] = false; } if ( empty( $data['general']['dashboard_widget_hidden'] ) ) { $data['general']['dashboard_widget_hidden'] = false; } if ( empty( $data['general']['uninstall'] ) ) { $data['general']['uninstall'] = false; } if ( empty( $data['general'][ UsageTracking::SETTINGS_SLUG ] ) ) { $data['general'][ UsageTracking::SETTINGS_SLUG ] = false; } if ( empty( $data['general'][ SummaryReportEmail::SETTINGS_SLUG ] ) ) { $data['general'][ SummaryReportEmail::SETTINGS_SLUG ] = false; } $is_summary_report_email_opt_changed = $options->is_option_changed( $options->parse_boolean( $data['general'][ SummaryReportEmail::SETTINGS_SLUG ] ), 'general', SummaryReportEmail::SETTINGS_SLUG ); // If this option was changed, cancel summary report email task. if ( $is_summary_report_email_opt_changed ) { ( new SummaryReportEmailTask() )->cancel(); } // All the sanitization is done there. $options->set( $data, false, false ); WP::add_admin_notice( esc_html__( 'Settings were successfully saved.', 'wp-mail-smtp' ), WP::ADMIN_NOTICE_SUCCESS ); } }