get_label(); } /** * @inheritdoc */ public function display() { $options = new Options(); ?>
check_admin_referer(); $options = new Options(); // Unchecked checkboxes doesn't exist in $_POST, so we need to ensure we actually have them in data to save. if ( empty( $data['general']['am_notifications_hidden'] ) ) { $data['general']['am_notifications_hidden'] = false; } if ( empty( $data['general']['uninstall'] ) ) { $data['general']['uninstall'] = false; } $to_save = array_merge( $options->get_all(), $data ); // All the sanitization is done there. $options->set( $to_save ); WP::add_admin_notice( esc_html__( 'Settings were successfully saved.', 'wp-mail-smtp' ), WP::ADMIN_NOTICE_SUCCESS ); } }