Code Duplication    Length = 12-12 lines in 2 locations

modules/custom-post-types/testimonial.php 1 location

@@ 270-281 (lines=12) @@
267
	/**
268
	 * On theme switch, check if CPT item exists and disable if not
269
	 */
270
	function deactivation_post_type_support() {
271
		$portfolios = get_posts( array(
272
			'fields'           => 'ids',
273
			'posts_per_page'   => 1,
274
			'post_type'        => self::CUSTOM_POST_TYPE,
275
			'suppress_filters' => false
276
		) );
277
278
		if ( empty( $portfolios ) ) {
279
			update_option( self::OPTION_NAME, '0' );
280
		}
281
	}
282
283
	/**
284
	 * Register Post Type

modules/custom-post-types/portfolios.php 1 location

@@ 202-213 (lines=12) @@
199
	/**
200
	 * On theme switch, check if CPT item exists and disable if not
201
	 */
202
	function deactivation_post_type_support() {
203
		$portfolios = get_posts( array(
204
			'fields'           => 'ids',
205
			'posts_per_page'   => 1,
206
			'post_type'        => self::CUSTOM_POST_TYPE,
207
			'suppress_filters' => false
208
		) );
209
210
		if ( empty( $portfolios ) ) {
211
			update_option( self::OPTION_NAME, '0' );
212
		}
213
	}
214
215
	/**
216
	 * Register Post Type