Code Duplication    Length = 14-15 lines in 8 locations

modules/theme-tools/content-options/customizer.php 8 locations

@@ 142-155 (lines=14) @@
139
		) ) );
140
141
		// Post Details: Date
142
		if ( ! empty( $date ) ) {
143
			$wp_customize->add_setting( 'jetpack_content_post_details_date', array(
144
				'default'              => 1,
145
				'type'                 => 'option',
146
				'transport'            => 'postMessage',
147
				'sanitize_callback'    => 'jetpack_content_options_sanitize_checkbox',
148
			) );
149
150
			$wp_customize->add_control( 'jetpack_content_post_details_date', array(
151
				'section'              => 'jetpack_content_options',
152
				'label'                => esc_html__( 'Display date', 'jetpack' ),
153
				'type'                 => 'checkbox',
154
			) );
155
		}
156
157
		// Post Details: Categories
158
		if ( ! empty( $categories ) ) {
@@ 158-171 (lines=14) @@
155
		}
156
157
		// Post Details: Categories
158
		if ( ! empty( $categories ) ) {
159
			$wp_customize->add_setting( 'jetpack_content_post_details_categories', array(
160
				'default'              => 1,
161
				'type'                 => 'option',
162
				'transport'            => 'postMessage',
163
				'sanitize_callback'    => 'jetpack_content_options_sanitize_checkbox',
164
			) );
165
166
			$wp_customize->add_control( 'jetpack_content_post_details_categories', array(
167
				'section'              => 'jetpack_content_options',
168
				'label'                => esc_html__( 'Display categories', 'jetpack' ),
169
				'type'                 => 'checkbox',
170
			) );
171
		}
172
173
		// Post Details: Tags
174
		if ( ! empty( $tags ) ) {
@@ 174-187 (lines=14) @@
171
		}
172
173
		// Post Details: Tags
174
		if ( ! empty( $tags ) ) {
175
			$wp_customize->add_setting( 'jetpack_content_post_details_tags', array(
176
				'default'              => 1,
177
				'type'                 => 'option',
178
				'transport'            => 'postMessage',
179
				'sanitize_callback'    => 'jetpack_content_options_sanitize_checkbox',
180
			) );
181
182
			$wp_customize->add_control( 'jetpack_content_post_details_tags', array(
183
				'section'              => 'jetpack_content_options',
184
				'label'                => esc_html__( 'Display tags', 'jetpack' ),
185
				'type'                 => 'checkbox',
186
			) );
187
		}
188
189
		// Post Details: Author
190
		if ( ! empty( $author ) ) {
@@ 190-203 (lines=14) @@
187
		}
188
189
		// Post Details: Author
190
		if ( ! empty( $author ) ) {
191
			$wp_customize->add_setting( 'jetpack_content_post_details_author', array(
192
				'default'              => 1,
193
				'type'                 => 'option',
194
				'transport'            => 'postMessage',
195
				'sanitize_callback'    => 'jetpack_content_options_sanitize_checkbox',
196
			) );
197
198
			$wp_customize->add_control( 'jetpack_content_post_details_author', array(
199
				'section'              => 'jetpack_content_options',
200
				'label'                => esc_html__( 'Display author', 'jetpack' ),
201
				'type'                 => 'checkbox',
202
			) );
203
		}
204
205
		// Post Details: Comment link
206
		if ( ! empty( $comment ) ) {
@@ 234-248 (lines=15) @@
231
		) ) );
232
233
		// Featured Images: Archive
234
		if ( true === $fi_archive ) {
235
			$wp_customize->add_setting( 'jetpack_content_featured_images_archive', array(
236
				'default'              => $fi_archive_default,
237
				'type'                 => 'option',
238
				'transport'            => 'refresh',
239
				'sanitize_callback'    => 'jetpack_content_options_sanitize_checkbox',
240
			) );
241
242
			$wp_customize->add_control( 'jetpack_content_featured_images_archive', array(
243
				'section'              => 'jetpack_content_options',
244
				'label'                => esc_html__( 'Display on blog and archives', 'jetpack' ),
245
				'type'                 => 'checkbox',
246
				'active_callback'      => 'jetpack_post_thumbnail_supports',
247
			) );
248
		}
249
250
		// Featured Images: Post
251
		if ( true === $fi_post ) {
@@ 251-265 (lines=15) @@
248
		}
249
250
		// Featured Images: Post
251
		if ( true === $fi_post ) {
252
			$wp_customize->add_setting( 'jetpack_content_featured_images_post', array(
253
				'default'              => $fi_post_default,
254
				'type'                 => 'option',
255
				'transport'            => 'refresh',
256
				'sanitize_callback'    => 'jetpack_content_options_sanitize_checkbox',
257
			) );
258
259
			$wp_customize->add_control( 'jetpack_content_featured_images_post', array(
260
				'section'              => 'jetpack_content_options',
261
				'label'                => esc_html__( 'Display on single posts', 'jetpack' ),
262
				'type'                 => 'checkbox',
263
				'active_callback'      => 'jetpack_post_thumbnail_supports',
264
			) );
265
		}
266
267
		// Featured Images: Page
268
		if ( true === $fi_page ) {
@@ 268-282 (lines=15) @@
265
		}
266
267
		// Featured Images: Page
268
		if ( true === $fi_page ) {
269
			$wp_customize->add_setting( 'jetpack_content_featured_images_page', array(
270
				'default'              => $fi_page_default,
271
				'type'                 => 'option',
272
				'transport'            => 'refresh',
273
				'sanitize_callback'    => 'jetpack_content_options_sanitize_checkbox',
274
			) );
275
276
			$wp_customize->add_control( 'jetpack_content_featured_images_page', array(
277
				'section'              => 'jetpack_content_options',
278
				'label'                => esc_html__( 'Display on pages', 'jetpack' ),
279
				'type'                 => 'checkbox',
280
				'active_callback'      => 'jetpack_post_thumbnail_supports',
281
			) );
282
		}
283
284
		// Featured Images: Fallback
285
		if ( true === $fi_fallback ) {
@@ 285-299 (lines=15) @@
282
		}
283
284
		// Featured Images: Fallback
285
		if ( true === $fi_fallback ) {
286
			$wp_customize->add_setting( 'jetpack_content_featured_images_fallback', array(
287
				'default'              => $fi_fallback_default,
288
				'type'                 => 'option',
289
				'transport'            => 'refresh',
290
				'sanitize_callback'    => 'jetpack_content_options_sanitize_checkbox',
291
			) );
292
293
			$wp_customize->add_control( 'jetpack_content_featured_images_fallback', array(
294
				'section'              => 'jetpack_content_options',
295
				'label'                => esc_html__( 'Automatically use first image in post', 'jetpack' ),
296
				'type'                 => 'checkbox',
297
				'active_callback'      => 'jetpack_post_thumbnail_supports',
298
			) );
299
		}
300
	}
301
}
302
add_action( 'customize_register', 'jetpack_content_options_customize_register' );