Code Duplication    Length = 21-21 lines in 2 locations

includes/admin/settings/class-wc-settings-checkout.php 1 location

@@ 234-254 (lines=21) @@
231
	/**
232
	 * Output the settings.
233
	 */
234
	public function output() {
235
		global $current_section;
236
237
		// Load shipping methods so we can show any global options they may have.
238
		$payment_gateways = WC()->payment_gateways->payment_gateways();
239
240
		if ( $current_section ) {
241
242
			foreach ( $payment_gateways as $gateway ) {
243
244
				if ( strtolower( get_class( $gateway ) ) == strtolower( $current_section ) ) {
245
					$gateway->admin_options();
246
					break;
247
				}
248
			}
249
		} else {
250
			$settings = $this->get_settings();
251
252
			WC_Admin_Settings::output_fields( $settings );
253
		}
254
	}
255
256
	/**
257
	 * Output payment gateway settings.

includes/admin/settings/class-wc-settings-shipping.php 1 location

@@ 163-183 (lines=21) @@
160
	/**
161
	 * Output the settings.
162
	 */
163
	public function output() {
164
		global $current_section;
165
166
		// Load shipping methods so we can show any global options they may have
167
		$shipping_methods = WC()->shipping->load_shipping_methods();
168
169
		if ( $current_section ) {
170
171
 			foreach ( $shipping_methods as $method ) {
172
173
				if ( strtolower( get_class( $method ) ) == strtolower( $current_section ) && $method->has_settings() ) {
174
					$method->admin_options();
175
					break;
176
				}
177
			}
178
 		} else {
179
			$settings = $this->get_settings();
180
181
			WC_Admin_Settings::output_fields( $settings );
182
		}
183
	}
184
185
	/**
186
	 * Save settings.