Code Duplication    Length = 16-16 lines in 2 locations

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

@@ 208-223 (lines=16) @@
205
	 *
206
	 * @return array Whitelisted post types.
207
	 */
208
	public function get_whitelisted_post_types() {
209
		$allowed_types = array( 'post', 'page', 'revision' );
210
211
		/**
212
		 * Filter the post types Jetpack has access to, and can synchronize with WordPress.com.
213
		 *
214
		 * @module json-api
215
		 *
216
		 * @since 2.2.3
217
		 *
218
		 * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`.
219
		 */
220
		$allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types );
221
222
		return array_unique( $allowed_types );
223
	}
224
225
	// copied and modified a little from class.json-api-endpoints.php
226
	private function user_can_view_post( $post ) {

class.json-api-endpoints.php 1 location

@@ 1699-1714 (lines=16) @@
1696
	 *
1697
	 * @return array Whitelisted post types.
1698
	 */
1699
	protected function _get_whitelisted_post_types() {
1700
		$allowed_types = array( 'post', 'page', 'revision' );
1701
1702
		/**
1703
		 * Filter the post types Jetpack has access to, and can synchronize with WordPress.com.
1704
		 *
1705
		 * @module json-api
1706
		 *
1707
		 * @since 2.2.3
1708
		 *
1709
		 * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`.
1710
		 */
1711
		$allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types );
1712
1713
		return array_unique( $allowed_types );
1714
	}
1715
1716
	function handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs = array(), $force_parent_id = false ) {
1717