Code Duplication    Length = 16-16 lines in 2 locations

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

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

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

@@ 1815-1830 (lines=16) @@
1812
	 *
1813
	 * @return array Whitelisted post types.
1814
	 */
1815
	protected function _get_whitelisted_post_types() {
1816
		$allowed_types = array( 'post', 'page', 'revision' );
1817
1818
		/**
1819
		 * Filter the post types Jetpack has access to, and can synchronize with WordPress.com.
1820
		 *
1821
		 * @module json-api
1822
		 *
1823
		 * @since 2.2.3
1824
		 *
1825
		 * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`.
1826
		 */
1827
		$allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types );
1828
1829
		return array_unique( $allowed_types );
1830
	}
1831
1832
	function handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs = array(), $force_parent_id = false ) {
1833