Code Duplication    Length = 18-18 lines in 2 locations

includes/admin/class-give-html-elements.php 2 locations

@@ 314-331 (lines=18) @@
311
	 *
312
	 * @return string           Categories dropdown.
313
	 */
314
	public function category_dropdown( $name = 'give_forms_categories', $selected = 0, $args = array() ) {
315
		$categories = get_terms( 'give_forms_category', apply_filters( 'give_forms_category_dropdown', array() ) );
316
317
		$options = array();
318
319
		foreach ( $categories as $category ) {
320
			$options[ absint( $category->term_id ) ] = esc_html( $category->name );
321
		}
322
323
		$output = $this->select( wp_parse_args( $args, array(
324
			'name'             => $name,
325
			'selected'         => $selected,
326
			'options'          => $options,
327
			'show_option_all'  => esc_html__( 'All Categories', 'give' ),
328
			'show_option_none' => false,
329
		) ) );
330
331
		return $output;
332
	}
333
334
	/**
@@ 348-365 (lines=18) @@
345
	 *
346
	 * @return string           Tags dropdown.
347
	 */
348
	public function tags_dropdown( $name = 'give_forms_tags', $selected = 0, $args = array() ) {
349
		$tags = get_terms( 'give_forms_tag', apply_filters( 'give_forms_tag_dropdown', array() ) );
350
351
		$options = array();
352
353
		foreach ( $tags as $tag ) {
354
			$options[ absint( $tag->term_id ) ] = esc_html( $tag->name );
355
		}
356
357
		$output = $this->select( wp_parse_args( $args, array(
358
			'name'             => $name,
359
			'selected'         => $selected,
360
			'options'          => $options,
361
			'show_option_all'  => esc_html__( 'All Tags', 'give' ),
362
			'show_option_none' => false,
363
		) ) );
364
365
		return $output;
366
	}
367
368
	/**