Code Duplication    Length = 34-35 lines in 2 locations

classes/logging.php 1 location

@@ 322-356 (lines=35) @@
319
	 *
320
	 * @return  array / false
321
	 */
322
	public static function get_connected_logs( $args = array() ) {
323
324
		$defaults = array(
325
			'post_parent'    => 0,
326
			'post_type'      => 'wp_log',
327
			'posts_per_page' => 10,
328
			'post_status'    => 'publish',
329
			'paged'          => get_query_var( 'paged' ),
330
			'log_type'       => 'salesforce',
331
		);
332
333
		$query_args = wp_parse_args( $args, $defaults );
334
335
		if ( $query_args['log_type'] && self::valid_type( $query_args['log_type'] ) ) {
336
337
			$query_args['tax_query'] = array(
338
				array(
339
					'taxonomy' => 'wp_log_type',
340
					'field'    => 'slug',
341
					'terms'    => $query_args['log_type'],
342
				),
343
			);
344
345
		}
346
347
		$logs = get_posts( $query_args );
348
349
		if ( $logs ) {
350
			return $logs;
351
		}
352
353
		// no logs found.
354
		return false;
355
356
	}
357
358
359
	/**

vendor/pippinsplugins/wp-logging/WP_Logging.php 1 location

@@ 365-398 (lines=34) @@
362
	 * @return  array / false
363
	*/
364
365
	public static function get_connected_logs( $args = array() ) {
366
367
		$defaults = array(
368
			'post_parent'    => 0,
369
			'post_type'      => 'wp_log',
370
			'posts_per_page' => 10,
371
			'post_status'    => 'publish',
372
			'paged'          => get_query_var( 'paged' ),
373
			'log_type'       => false
374
		);
375
376
		$query_args = wp_parse_args( $args, $defaults );
377
378
		if( $query_args['log_type'] && self::valid_type( $query_args['log_type'] ) ) {
379
380
			$query_args['tax_query'] = array(
381
				array(
382
					'taxonomy' => 'wp_log_type',
383
					'field'    => 'slug',
384
					'terms'    => $query_args['log_type']
385
				)
386
			);
387
388
		}
389
390
		$logs = get_posts( $query_args );
391
392
		if( $logs )
393
			return $logs;
394
395
		// no logs found
396
		return false;
397
398
	}
399
400
401
	/**