Code Duplication    Length = 16-16 lines in 2 locations

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

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

class.json-api-endpoints.php 1 location

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