Code Duplication    Length = 10-11 lines in 3 locations

modules/infinite-scroll/themes/twentyeleven.php 1 location

@@ 41-51 (lines=11) @@
38
/**
39
 * Do we have footer widgets?
40
 */
41
function jetpack_twentyeleven_has_footer_widgets() {
42
	// Are any of the "Footer Area" sidebars active?
43
	if ( is_active_sidebar( 'sidebar-3' ) || is_active_sidebar( 'sidebar-4' ) || is_active_sidebar( 'sidebar-5' ) )
44
		return true;
45
46
	// If we're on mobile and the Main Sidebar has widgets, it falls below the content, so we have footer widgets.
47
	if ( function_exists( 'jetpack_is_mobile' ) && jetpack_is_mobile() && is_active_sidebar( 'sidebar-1' ) )
48
		return true;
49
50
	return false;
51
}
52
53
/**
54
 * Load AMP theme specific hooks for infinite scroll.

modules/infinite-scroll/themes/twentyfourteen.php 1 location

@@ 34-44 (lines=11) @@
31
 *
32
 * @return bool
33
 */
34
function jetpack_twentyfourteen_has_footer_widgets() {
35
	if ( function_exists( 'jetpack_is_mobile' ) ) {
36
		if ( ( Jetpack_User_Agent_Info::is_ipad() && is_active_sidebar( 'sidebar-1' ) )
37
			|| ( jetpack_is_mobile( '', true ) && ( is_active_sidebar( 'sidebar-1' ) || is_active_sidebar( 'sidebar-2' ) ) )
38
			|| is_active_sidebar( 'sidebar-3' ) )
39
40
			return true;
41
	}
42
43
	return false;
44
}
45
46
/**
47
 * Enqueue CSS stylesheet with theme styles for Infinite Scroll.

modules/infinite-scroll/themes/twentytwelve.php 1 location

@@ 41-50 (lines=10) @@
38
/**
39
 * Do we have footer widgets?
40
 */
41
function jetpack_twentytwelve_has_footer_widgets() {
42
	if ( function_exists( 'jetpack_is_mobile' ) && jetpack_is_mobile() ) {
43
		if ( is_front_page() && ( is_active_sidebar( 'sidebar-2' ) || is_active_sidebar( 'sidebar-3' ) ) )
44
			return true;
45
		elseif ( is_active_sidebar( 'sidebar-1' ) )
46
			return true;
47
	}
48
49
	return false;
50
}
51
52
/**
53
 * Load AMP theme specific hooks for infinite scroll.