Code Duplication    Length = 24-24 lines in 2 locations

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

@@ 75-98 (lines=24) @@
72
 *
73
 * @return string
74
 */
75
function twentythirteen_amp_infinite_output( $buffer ) {
76
	// Hide site header on next page load.
77
	$buffer = preg_replace(
78
		'/<header id="masthead"/',
79
		'$0 next-page-hide',
80
		$buffer
81
	);
82
83
	// Hide below nav bar.
84
	$buffer = preg_replace(
85
		'/<nav class="navigation paging-navigation"/',
86
		'$0 next-page-hide hidden',
87
		$buffer
88
	);
89
90
	// Remove the footer as it will be added back to amp next page footer.
91
	$buffer = preg_replace(
92
		'/<footer id="colophon".*<!-- #colophon -->/s',
93
		'',
94
		$buffer
95
	);
96
97
	return $buffer;
98
}
99
100
/**
101
 * Filter the AMP infinite scroll older posts button

modules/theme-tools/compat/twentynineteen.php 1 location

@@ 166-189 (lines=24) @@
163
 *
164
 * @return string
165
 */
166
function twentynineteen_amp_infinite_output( $buffer ) {
167
	// Hide site header on next page load.
168
	$buffer = preg_replace(
169
		'/id="masthead"/',
170
		'$0 next-page-hide',
171
		$buffer
172
	);
173
174
	// Hide pagination on next page load.
175
	$buffer = preg_replace(
176
		'/class=".*navigation pagination.*"/',
177
		'$0 next-page-hide hidden',
178
		$buffer
179
	);
180
181
	// Remove the footer as it will be added back to amp next page footer.
182
	$buffer = preg_replace(
183
		'/<footer id="colophon".*<!-- #colophon -->/s',
184
		'',
185
		$buffer
186
	);
187
188
	return $buffer;
189
}
190
191
/**
192
 * Filter the AMP infinite scroll older posts button