Code Duplication    Length = 16-16 lines in 2 locations

projects/plugins/jetpack/class.json-api-endpoints.php 1 location

@@ 1803-1818 (lines=16) @@
1800
	 *
1801
	 * @return array Whitelisted post types.
1802
	 */
1803
	protected function _get_whitelisted_post_types() {
1804
		$allowed_types = array( 'post', 'page', 'revision' );
1805
1806
		/**
1807
		 * Filter the post types Jetpack has access to, and can synchronize with WordPress.com.
1808
		 *
1809
		 * @module json-api
1810
		 *
1811
		 * @since 2.2.3
1812
		 *
1813
		 * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`.
1814
		 */
1815
		$allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types );
1816
1817
		return array_unique( $allowed_types );
1818
	}
1819
1820
	function handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs = array(), $force_parent_id = false ) {
1821

projects/plugins/jetpack/sal/class.json-api-site-base.php 1 location

@@ 292-307 (lines=16) @@
289
	 *
290
	 * @return array Whitelisted post types.
291
	 */
292
	public function get_whitelisted_post_types() {
293
		$allowed_types = array( 'post', 'page', 'revision' );
294
295
		/**
296
		 * Filter the post types Jetpack has access to, and can synchronize with WordPress.com.
297
		 *
298
		 * @module json-api
299
		 *
300
		 * @since 2.2.3
301
		 *
302
		 * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`.
303
		 */
304
		$allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types );
305
306
		return array_unique( $allowed_types );
307
	}
308
309
	// copied and modified a little from class.json-api-endpoints.php
310
	private function user_can_view_post( $post ) {