Code Duplication    Length = 16-16 lines in 2 locations

class.json-api-endpoints.php 1 location

@@ 1774-1789 (lines=16) @@
1771
	 *
1772
	 * @return array Whitelisted post types.
1773
	 */
1774
	protected function _get_whitelisted_post_types() {
1775
		$allowed_types = array( 'post', 'page', 'revision' );
1776
1777
		/**
1778
		 * Filter the post types Jetpack has access to, and can synchronize with WordPress.com.
1779
		 *
1780
		 * @module json-api
1781
		 *
1782
		 * @since 2.2.3
1783
		 *
1784
		 * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`.
1785
		 */
1786
		$allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types );
1787
1788
		return array_unique( $allowed_types );
1789
	}
1790
1791
	function handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs = array(), $force_parent_id = false ) {
1792

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

@@ 252-267 (lines=16) @@
249
	 *
250
	 * @return array Whitelisted post types.
251
	 */
252
	public function get_whitelisted_post_types() {
253
		$allowed_types = array( 'post', 'page', 'revision' );
254
255
		/**
256
		 * Filter the post types Jetpack has access to, and can synchronize with WordPress.com.
257
		 *
258
		 * @module json-api
259
		 *
260
		 * @since 2.2.3
261
		 *
262
		 * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`.
263
		 */
264
		$allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types );
265
266
		return array_unique( $allowed_types );
267
	}
268
269
	// copied and modified a little from class.json-api-endpoints.php
270
	private function user_can_view_post( $post ) {